akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
using namespace std;
int main(){
    int n;
    cin >> n;
    stack<int> s;
    vector<int> vec(n);
    for(int i=0;i<n;i++){
        cin >> vec[i];
    }
    bool h1=true;
    while(1){
        bool h=true;
        for(int i=vec.size();i>=0;i--){
            if(vec[i]==i+1){
                 //   cout<<i<<" "<<vec[i]<<endl;
                vec.erase(vec.begin()+i);
              //  cout<<vec[0]<<" "<<vec[1]<<" "<<vec[2]<<" "<<vec[3]<<endl;
                vec[vec.size()]=0;
              //    cout<<vec[0]<<" "<<vec[1]<<" "<<vec[2]<<" "<<vec[3]<<endl;
              // 
                s.push(i+1);
                h=false;
                break;
            }
        }
        if(vec[0]==0){
            break;
        }
        if(h){
            h1=false;
            break;
            
        }
    }
//    cout<<s.size()<<endl;
    if(!h1){
        cout<<-1<<endl;
    }else{
        for(int i=0;i<n;i++){
            cout<<s.top()<<endl;
            s.pop();
        }
    }
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long INT;
double PI = 3.14159265;

const long long INF = 1LL << 60;
//---//


int main() {
    int k, n, mx = 0, a,b,fi;

    cin >> k >> n >> b;

    fi = b;
    rep(i, n) {
        if (i == n - 1)mx=max(mx, fi + k - a);
        else {
            cin >> a;
            mx = max(mx, a - b);
        }
        b = a;
    }

    cout << k-mx << endl;

  return 0;
}

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

#define in cin
#define out cout

#define REP(i,n) for(int i=0; i<n; i++)
#define REP2(i,s,e) for(int i=s; i<e; i++)
#define REPD(i,s,e,d) for(int i=s; i<=e; i+=d)
#define REPE(i,s,e) for(int i=s; i<=e; i++)
#define REPR(i,s,e) for(int i=s; i>=e; i--)

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

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define rd(n) scanf("%d", &n)

#define x first
#define y second
#define intINF 2147483647
#define llINF 9223372036854775807LL
#define MOD 1000000007

bool res = false;
string S;
int dp[101010]; // -1 : unknown, 1 : possible, 0 : impossible

string words[] = {"dream", "dreamer", "erase", "eraser"};

bool match(int i, int word_id)
{
    for(int j=0; j<words[word_id].size(); j++)
    {
        if(i+j > S.size()) return false;
        if(words[word_id][j] != S[i+j]) return false;
    }

    return true;
}

int f(int i)
{
    if(i == S.size()) return true;
    if(i > S.size()) return false;
    if(dp[i] != -1) return dp[i];

    bool possible = false;
    REP(j, 4) possible |= (match(i, j) && f(i+words[j].size()));

    return dp[i] = possible;
}

int main()
{
    memset(dp, -1, sizeof(dp));
    in >> S;

    if(f(0)) out << "YES\n"; else out << "NO\n";

    return 0;
}


Measured memory_bytes: 1664
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#include<set>
#include<cstdlib>
#include<cctype>
#include<ctime>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll maxn = 1e5 + 5;
const ll maxm = 1e3 + 5;
template<class T>
inline T qread(T &IEE){
	register T x = 0, f = 1;
	register char ch = getchar();
	while(!isdigit(ch)){
		if(ch == '-'){
			f = -f;
		}
		ch = getchar();
	}
	while(isdigit(ch)){
		x = (x << 1) + (x << 3) + (ch ^ 48);
		ch = getchar();
	}
	return IEE = x * f;
}
template<class T>
inline void qwrite(T a){
	if(!a){
		putchar('0');
		return ;
	}
 	if(a < 0){
		putchar('-');
		a = -a;
	}
	if(a > 9) qwrite(a / 10);
	putchar(a % 10 + 48);
	return ;
}
template<class T>
inline T ab(T a){
	return (a > 0) ? a : -a;
}
template<class T>
inline void swa(T &a, T &b){
	a ^= b ^= a ^= b;
	return ;
}
ll a, b, c, d;
int main(){
//	freopen("1.in", "r", stdin);
//	freopen("1.out", "w", stdout);
	qread(a);
	qread(b);
	qread(c);
	qread(d);
	while(true){
		c -= b;
		if(c <= 0){
			puts("Yes");
			return 0;
		}
		a -= d;
		if(a <= 0){
			puts("No");
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <vector>
#include <tuple>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
typedef long long ll;

int N,M,H,W,K,A,B;
string S;
string alpha = "abcdefghijklmnopqrstuvwxyz";
string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int MOD = 1000000007;
int main() {
    cin>>N;
    vector<ll> dp(N+1);
    queue<int> que;
    cin>>M;
    rep(i,M) {
        cin>>A;
        que.push(A);
    }
    dp.at(0) = 1;
    int q;
    if(M != 0) {
        q = que.front();
        que.pop();
    }else{
        q = -1;
    }
    reps(i,1,N+1){
        if(i == q){
            dp.at(i) = 0;
            if(que.size()){
                q = que.front();
                que.pop();
            }
            continue;
        }
        if(i == 1) {
            dp.at(i) = 1;
        }else{
            dp.at(i) = dp.at(i-1) + dp.at(i-2);
            (dp.at(i) += MOD) %=MOD;
        }
    }
    cout<<dp.at(N)<<endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#include <numeric>
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
using namespace std;

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

    int X, A; cin >> X >> A;
    int res;
    if (X < A) res = 0;
    else res = 10;

    cout << res << endl;
}

Measured memory_bytes: 892
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cstring>
#include<algorithm>

using namespace std;

const int N=1e5+9;
int n;
int a[N];

inline int gcd(int a,int b)
{
	if(b==0)return a;
	return gcd(b,a%b);
}

inline bool solve()
{
	int flag=0;
	int odds=0;
	for(int i=1;i<=n;i++)
		if(a[i]&1)odds++;

	if(!odds)
	{
		for(int i=1;i<=n;i++)
			a[i]>>=1;
		return solve();
	}

	if(odds==1 && n&1)
	{
		int gcds=0;
		for(int i=1;i<=n;i++)
			gcds=gcd(a[i],gcds);
		for(int i=1;i<=n;i++)
		{
			if(a[i]==gcds)
				return 0;
			if(a[i]&1)
				a[i]-=gcds;
		}
		return !solve();
	}

	for(int i=1;i<=n;i++)
		flag^=((a[i]+1)&1);
	return flag;
}

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	printf("%s\n",solve()?"First":"Second");
	return 0;
}


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            Array.Sort(array);

            if (N % 3 == 0)
            {
                N /= 3;
                if (array[0] == array[N - 1] && array[N] == array[2 * N - 1] && array[2 * N] == array[3 * N - 1] && (array[0]^array[N]^array[2*N]) == 0)
                    Console.WriteLine("Yes");
                else
                    Console.WriteLine("No");
            }
            else
            {
                if (array[N - 1] == 0)
                    Console.WriteLine("Yes");
                else
                    Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 22496
//libraries
#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>

//namespace
using namespace std;
using namespace __gnu_pbds;

//typedef
//typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef vector<long long> vll;

//define
#define i(X) cin>>X;
#define ol(X) cout<<X<<endl;
#define os(X) cout<<X<<" ";
#define inpv(a,n) vector<ll> a(n); for(ll i=0;i<n;i++){cin>>a[i];}
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define line cout<<"\n";
#define pbp(a,b) push_back(make_pair(a,b));
#define iniv(A,n,p) vector<ll> A(n,p);
#define vst(A) sort(A.begin(),A.end());
#define rvst(A) sort(A.rbegin(),A.rend());
#define forin(i,a,b) for(ll i=a;i<=b;i++)
#define forde(i,a,b) for(ll i=a;i>=b;i--)
#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const long long inf=(long long)1e18;
long long MOD=(long long)(1e9+7);
ll mod=MOD;

ll power(ll x,ll y)
{
    if (y == 0)
        return 1;
    ll p = power(x, y/2) % MOD;
    p = (p * p) % MOD;

    return (y%2 == 0)? p : (x * p) % MOD;
}

int main() 
{
	// #ifndef ONLINE_JUDGE
    //    freopen ("input.txt" , "r" , stdin);
	// 	// freopen ("OUTPUT.txt" , "w" , stdout);
	// #endif
	fio;
	ll testcase=1;
	//cin>>testcase;
	while(testcase--)
	{
		ld a,b,c;
		cin>>a>>b>>c;
		string s=(a/c<=b)?"Yes":"No";
		ol(s);
	}
}

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

int main(){
	int n,a,hill;
	double t,x;
	cin >> n >> t >> a;
	double nearest=1e6;
	for(int i=0; i<n; i++){
		cin >> x;
		x = abs(a-(t - x * 0.006));
		if(x<nearest)nearest=x,hill=i+1;
	}
	cout << hill <<endl;
	return 0;
}

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

int main(){
    ll x;
    cin>>x;
    ll rank[8]={8,7,6,5,4,3,2,1};
    x-=400;
    cout<<rank[x/200]<<endl;
    return 0;
}

Measured memory_bytes: 3644
#include <cstdio>
#include <algorithm>
typedef long long ll;
using std::swap;

ll abs(ll x)
{
	if (x < 0) return -x;
	return x;
}
ll update(ll &a, ll b)
{
	if (a > b) a = b;
}

ll diff(ll x, ll y, ll z)
{
	if (x > y) swap(x,y);
	if (y > z) swap(y,z);
	if (x > y) swap(x,y);
	return z - x;
}


void devide_two(ll x, ll y, ll &s1, ll &s2, bool flag = false)
{
	ll mid = x/2;
	ll s1_ = mid * y, s2_ = (x - mid) * y;
	if (!flag || abs(s1_ - s2_) < abs (s1 -s2))
	{
		s1 = s1_;
		s2 = s2_; 
	}
	if (!flag)
	{
		devide_two(y,x,s1,s2,true);
	}
}
void find(ll x, ll y, ll &ans, bool flag = false)
{
	ll part = x / 3;
	if (part > 0)
	{
		ll s0 = part * y;
		ll s1 = 0, s2 = 0;
		devide_two(x - part, y, s1, s2);
		update(ans, diff(s0,s1,s2));
	}
	part++;
	ll s0 = part * y;
	ll s1 = 0, s2 = 0;
	devide_two(x - part, y, s1, s2);
	update(ans, diff(s0,s1,s2));
	
	if (!flag)
		find(y,x,ans,true);
}

int main()
{
	ll x,y;
	scanf("%lld%lld",&x,&y);
	ll ans = 1000000000;
	find(x,y,ans);
	printf("%lld\n",ans);
}

Measured memory_bytes: 128
#include<stdio.h>

int prime[1000005];

int main(){
  int i, j, n, ans;
  for(i = 2;i <= 1000;i++){
    if(prime[i] == 1)continue;
    else{
      for(j = i * i;j < 1000000;j += i)
        prime[j] = 1;
    }
  }
  while(scanf("%d", &n) != EOF){
    ans = 0;
    for(i = 2;i <= n;i++){
      if(prime[i] == 0)ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}

Measured memory_bytes: 4500
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)

const int mod = 1000000007;
struct mint {
ll x; 
mint(ll x=0):x((x%mod+mod)%mod){}
mint operator-() const { return mint(-x);}
mint& operator+=(const mint a) {
if ((x += a.x) >= mod) x -= mod;
return *this;
 }
mint& operator-=(const mint a) {
if ((x += mod-a.x) >= mod) x -= mod;
return *this;
 }
 mint& operator*=(const mint a) {
(x *= a.x) %= mod;
return *this;
}
mint operator+(const mint a) const {
mint res(*this);
return res+=a;
}
mint operator-(const mint a) const {
mint res(*this);
return res-=a;
}
 mint operator*(const mint a) const {
mint res(*this);
return res*=a;
}
mint pow(ll t) const {
if (!t) return 1;
mint a = pow(t>>1);
a *= a;
if (t&1) a *= *this;
return a;
}
 mint inv() const {
return pow(mod-2);
 }
  mint& operator/=(const mint a) {
return (*this) *= a.inv();
 }
mint operator/(const mint a) const {
mint res(*this);
return res/=a;
 }
};
struct combination {
vector<mint> fact, ifact;
combination(int n):fact(n+1),ifact(n+1) {
  assert(n < mod);
 fact[0] = 1;
 for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
 ifact[n] = fact[n].inv();
  for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
}
mint operator()(int n, int k) {
if (k < 0 || k > n) return 0;
return fact[n]*ifact[k]*ifact[n-k];
}
  };
int main() {
ios::sync_with_stdio(false);
cin.tie(0);

int N;
cin>>N;
vector<ll>x(N);
rep(i,N)cin>>x[i];
combination c(N+1);

mint ans=0;
mint count=1;
for(int i=0;i+1<N;i++){
    ans+=count*(x[i+1]-x[i]);
    count+=mint(i+2).inv();
}
ans=ans*c.fact[N-1];
cout<<ans.x<<endl;
return 0;
}

Measured memory_bytes: 2560
#include<iostream>
#include<stdio.h>
#include<string>

using namespace std;

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



Measured memory_bytes: 3116
N, M = map(int, input().split())
H_list = list(map(int, input().split()))
conected_list = []

for n in range(N):
    conected_list.append([])

for m in range(M):
    a, b = map(int, input().split())
    conected_list[a - 1].append(b - 1)
    conected_list[b - 1].append(a - 1)

count = 0

for n in range(N):
    n_h = H_list[n]
    flg = True
    for i in conected_list[n]:
        if(n_h <= H_list[i]):
            flg = False
    
    if(flg):
        count += 1
        
print(count)


Measured memory_bytes: 29372
n, y = map(int, input().split())
x = 0
for i in range(n + 1):
    if 10000*i > y:break

    for j in range(n - i + 1):
        if 10000 * i + 5000 * j > y:
            break
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
            print(i, j, n - i - j)
            x = 1
            break

    if x == 1:
        break

if x == 0:
    print(-1,-1,-1)

Measured memory_bytes: 41836
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <utility>
#include <algorithm>

using namespace std;

vector<int> dx = {0, 1, 0, -1};
vector<int> dy = {1, 0, -1, 0};

template<typename T> 
void show(T a){
  for(auto i : a){ cout << i << " "; }
  cout << endl;
}
template<typename T> 
void showmatrix(T a){
  for(auto j: a){for(auto i : j){ cout << i; }cout << endl;}
  cout << endl;
}
void check(int i = 0){
  cout << "checkpoint:[" << i << "]" << endl;
}


int main(int argc, char *argv[]){
  ios::sync_with_stdio(false);
  cin.tie(NULL);

  int n, m, c;
  long long count = 0;
  cin >> n >> m >> c;
  vector<long long> b(m, 0);
  vector<long long> a(m, 0);
  for(auto& i : b){
    cin >> i;
  }
  for(int j = 0; j < n; j++){
    for(auto& i : a){
      cin >> i;
    }
    long long res = 0;
    for(int i =0;i<m;i++){
      res += a[i]*b[i];
    }
    if(res + c > 0) count++;
  }

  cout << count << endl;


}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;
#define pi 3.1415926

int a[(int)2e5][11];

int main(){
    int h, a, br=0;
    cin >> h >> a;
    while(h > 0){
        h = h - a;
        br++;
    }
    cout << br;
    
    
    
}

    

		


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
	int n, m, buf;
	int* a;
	cin >> n >> m;
	
	for (int i = 0; i < m; i++) {
		cin >> buf;
		n -= buf;
	}
	if (n < 0) n = -1;
	cout << n << "\n";
	return 0;
}

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


using namespace std;
using ll = long long;


int main () {

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    
    int N; cin >> N;
    for (int i = 1; i < 10; ++i) {
        for (int j = 1; j < 10; ++j) {
            if (i*j == N) {
                cout << "Yes" << '\n'; return 0;
            }
        }
    }cout << "No" << '\n';
}



Measured memory_bytes: 3648
import Control.Monad
import Control.Applicative

solve :: String -> String
solve [] = []
solve xs = do
  if length xs < 7
    then xs
    else do
      let (a:b:c:d:e:f:g:gs) = xs
      if (a:b:c:d:e:f:[g]) == "Hoshino"
        then "Hoshina" ++ (solve gs)
        else a : solve (b:c:d:e:f:g:gs)

main = do
  getLine
  contents <- unlines . (map solve . lines) <$> getContents
  putStr contents

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

using namespace std;
#define DBG(x)                         \
    (void)(cout << "L" << __LINE__     \
                << ": " << #x << " = " \
                << (x) << '\n')
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
typedef long long ll;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
const int INF = 0x3f3f3f3f;
const int maxn = 110000;
int main()
{
    //检查有没有特判0,有没有越界限.
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setiosflags(ios::fixed) << setprecision(12);
    int n, m;
    cin >> n >> m;
    priority_queue<int> q;
    for (int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;
        q.push(x);
    }
    while (m--)
    {
        int cur = q.top();
        q.pop();
        cur /= 2;
        q.push(cur);
    }
    ll ans = 0;
    while (!q.empty())
    {
        int cur = q.top();
        q.pop();
        ans += 1ll * cur;
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3844
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"
#include "string"

using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i = 0; i < n; i++)

int main() {
	int n, m, k;
	cin >> n >> m >> k;
	for (int i = 0; i <= n; ++i) {
		for (int j = 0; j <= m; ++j) {
			if (m * i + n * j - 2 * i * j == k) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}

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

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


Measured memory_bytes: 3104
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<cstring>
using namespace std;
int semi[51][51],h,w,r[51][51];
int min(int a,int b){
	if(a<b){
		return a;
	}else{
		return b;
	}
}
int max(int a,int b){
	if(a>b){
		return a;
	}else{
		return b;
	}
}
int min(int a,int b,int c,int d){
	int mini;
	mini=min(a,b);
	mini=min(mini,c);
	mini=min(mini,d);
	return mini;
}
int main(){
	while(1){
		int n,i,j,x[201],y[201],xmax=0,xmin=0,ymax=0,ymin=0,a,d;
		cin>>n;
		if(n==0)break;
		x[0]=0;y[0]=0;
		for(i=1;i<n;i++){
			cin>>a>>d;
			switch(d){
			case 0:
				x[i]=x[a]-1;y[i]=y[a];
				xmin=min(xmin,x[i]);
				break;
			case 1:
				x[i]=x[a];y[i]=y[a]-1;
				ymin=min(ymin,y[i]);
				break;
			case 2:
				x[i]=x[a]+1;y[i]=y[a];
				xmax=max(x[i],xmax);
				break;
			case 3:
				x[i]=x[a];y[i]=y[a]+1;
				ymax=max(y[i],ymax);
				break;
			default:
				break;
			}
		}
	cout<<xmax-xmin+1<<' '<<ymax-ymin+1<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>

using namespace std;

int LCM(int a, int b) {
	int i = 2;
	int gcd = 1;
	
	while (i <= a && i <= b) {
		if (a % i == 0 && b % i == 0) {
			gcd *= i;
			a /= i;
			b /= i;
		}
		else i++;
	}
	return a * b * gcd;

}

int main(){

	int size;
	cin >> size;
	int a;

	int result = 1;
	for (int i = 0; i < size; i++) {
		cin >> a;
		result = LCM(result, a);
	}

	cout << result << endl;
	//system("pause");
	return 0;
	
}




Measured memory_bytes: 3100
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

int main(){
	int N; std::cin >> N;
	std::vector<int> a(N);
	for (auto& r : a) {
		int t; std::cin >> t;
		r = t - 1;
	}

	int count = 0;
	for (int i = 0; i < N; ++i)
		if (a[a[i]] == i)++count;

	std::cout << count / 2 << std::endl;

}

Measured memory_bytes: 3764
n, k = map(int, input().split())
pn = list(map(int, input().split()))

sm = sum(pn[:k])
maxi = sm
for i in range(n-k):
  sm -= pn[i]
  sm += pn[i+k]
  maxi = max(maxi, sm)
print((maxi + k) / 2.0)
  

Measured memory_bytes: 25060
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
*this << "[";
for (auto it = d.b; it != d.e; ++it)
*this << ", " + 2 * (it == d.b) << *it;
ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int  long long int
#define pb push_back
#define fe first
#define lb lower_bound 
#define ub upper_bound
#define pii pair<pair<int,int>,pair<int,int> >
#define se second
#define endl "\n"
#define pi pair<int, int>
#define mi          map<int,int>
#define mii         map<pi,int>
#define vi vector<int> 
#define vvi vector<vi>
#define bs   binary_search
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,a,b) for(int i=a;i<=b;i++)	
#define all(c) (c).begin(),(c).end()
#define sz(x)       (int)x.size() 
#define PI 3.14159265358979323846

 const int N=2e5+5;

 int mod= 1e9+7;
 int dx[4]={0,0,+1,-1};
 int dy[4]={+1,-1,0,0};  
 
 
int po(int a, int b) {
	a %= mod;
	int res = 1;
	while (b > 0) {
		if (b & 1)
			res = (res * a) % mod;
		a =(a*a) % mod;
		b >>= 1;
	}
	 return res;	
   }

 void solve() {
  
   int a;
   cin>>a;
   int res=a+a*a+a*a*a;
   cout<<res<<endl; 
    					   
 }

    
int32_t main() {
	cool;
	int t=1;

	//cin>>t;
	while(t--)
	solve();


return 0;	   
}


Measured memory_bytes: 3656
#include <iostream>

using namespace std;

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

	char fig[H][W];

	for(int i = 0; i < H; i++){
		for(int j = 0; j <W; j++){
			cin >> fig[i][j];
		}
	}

	for(int i = 0; i < W + 2; i++){
		printf("#");
	}
	printf("\n");

	for(int i = 0; i < H; i++){
		printf("#");
		for(int j = 0; j < W; j++){
			printf("%c", fig[i][j]);
		}
		printf("#\n");
	}

	for(int i = 0; i < W + 2; i++){
			printf("#");
	}
	printf("\n");

	return 0;
}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
#include <assert.h>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <double,P> PP;
  
static const double EPS = 1e-8;

class SternBrocotTree {
public:
  SternBrocotTree(int B,int p)
    : max_depth(0),
      ans_left_numerator(0),
      ans_right_numerator(0),
      ans_left_denominator(0),
      ans_right_denominator(0){
    this->B = B;
    this->p = p;
  }

  void dfs(int left_numerator,int left_denominator,
           int right_numerator,int right_denominator,int depth){
    int next_numerator = left_numerator + right_numerator;
    int next_denominator = left_denominator + right_denominator;

    if(contains(left_numerator,left_denominator,next_numerator,next_denominator)){
      dfs(left_numerator,left_denominator,next_numerator,next_denominator,depth+1);
    }

    if(max_depth < depth){
      max_depth = depth;
      ans_right_numerator = right_numerator;
      ans_right_denominator = right_denominator;
      ans_left_numerator = left_numerator;
      ans_left_denominator = left_denominator;
    }

    if(contains(next_numerator,next_denominator,right_numerator,right_denominator)){
      dfs(next_numerator,next_denominator,right_numerator,right_denominator,depth+1);
    }
  }
  void disp(){
    printf("%d/%d %d/%d\n",
           ans_right_numerator,ans_right_denominator,
           ans_left_numerator,ans_left_denominator);
  }
private:
  int B;
  int p;
  int max_depth;
  int ans_left_numerator;
  int ans_left_denominator;
  int ans_right_numerator;
  int ans_right_denominator;
  
  bool contains(int left_numerator,int left_denominator,
                int right_numerator,int right_denominator){
    if(left_numerator > B || left_denominator > B
       || right_numerator > B || right_denominator > B) return false;
    if(left_numerator * left_numerator < left_denominator * left_denominator * p
       && p * right_denominator * right_denominator < right_numerator * right_numerator){
      return true;
    }
    return false;
  }
};

int main(){
  int p;
  int n;

  while(~scanf("%d %d",&p,&n)){
    if(p == 0 && n == 0) break;
    SternBrocotTree sbt(n,p);
    sbt.dfs(0,1,1,0,0);
    sbt.disp();
  }
}

Measured memory_bytes: 1192
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

#define ll long long
#define P pair<int, int>
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define GI(name) \
  int(name);     \
  scanf("%d", &(name))
#define GI2(name1, name2) \
  int(name1), (name2);    \
  scanf("%d %d", &(name1), &(name2))
#define GI3(name1, name2, name3) \
  int(name1), (name2), (name3);  \
  scanf("%d %d %d", &(name1), &(name2), &(name3))
#define GVI(name, size)    \
  vector<int>(name)(size); \
  FOR(i, (size)) scanf("%d", &(name)[i])
#define GS(name) \
  string(name);  \
  cin >> (name);
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

string to_string(string s) {
  return s;
}

template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  FOR(i, v.size() - 1) { ret += to_string(v[i]) + ","; }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}

void debug() {
  cerr << endl;
}

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

void print() {
  cout << endl;
}

template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}

int main() {
  GS(S);
  map<char, int> list;
  FOR(i, S.size()) { list[S[i]]++; }
  int mx = max({list['a'], list['b'], list['c']});
  int mn = min({list['a'], list['b'], list['c']});
  print(mx - mn <= 1 ? "YES" : "NO");
  return 0;
}

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

int main() {
  int h,w;
  cin >> h >> w;
  
  char a[101][101],ans[102][102];
  
  for(int i = 0;i < h;i++){
    cin >> a[i];
  }
  for(int i = 0;i < h + 2; i++){
    for(int j = 0; j < w + 2;j++){
      ans[i][j] = '#';
    }
  }
  for(int i = 0;i < h;i++){
    for(int j = 0; j < w;j++){
      ans[i + 1][j + 1] = a[i][j];
    }
  }
  for(int i = 0;i < h + 2;i++){
    for(int j = 0; j < w + 2;j++){
      cout << ans[i][j];
    }
    cout << endl;
  }
}

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

const int inf=0x3f3f3f3f;
const int maxn=100000+5;
int pre[maxn];
int suc[maxn];
struct seg{
    int l;
    int r;
    bool operator<(const seg oth)const{
        if(l==oth.l) return r<oth.r;
        return l<oth.l;
    }
    seg(int _l,int _r):l(_l),r(_r){}
    seg(){}
};
vector<seg> vec;
int n;
int maxl;
int minr;
int maxr;
int minl;

int main(){
    maxl=0;minr=inf;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        int l,r;scanf("%d%d",&l,&r);
        vec.push_back(seg(l,r));
        minr=min(minr,r);
    }
    sort(vec.begin(),vec.end());
    maxl=vec[n-1].l;
    maxr=vec[n-1].r;
    for(int i=0;i<vec.size();i++){
        if(i) pre[i]=min(pre[i-1],vec[i].r);
        else pre[i]=vec[i].r;
        if((!minl)&&vec[i].r==minr) minl=vec[i].l;
    }
    for(int i=vec.size()-1;i>=0;i--){
        if(i==vec.size()-1) suc[i]=vec[i].r;
        else suc[i]=min(suc[i+1],vec[i].r);
    }
    int ans=0;
    for(int i=0;i<vec.size();i++){
        int cur=max(0,minr-maxl+1);
        cur+=max(0,vec[i].r-vec[i].l+1);
        ans=max(ans,cur);
    }
    for(int i=0;i<vec.size()-1;i++){
        int ta=max(0,minr-vec[i].l+1);
        int tb=max(0,suc[i+1]-maxl+1);
        ans=max(ans,ta+tb);
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 1908
#include<iostream>

using namespace std;

int main(){
  int n, i, Apoint, Bpoint;
  int A[10000], B[10000];
  while(cin >> n ,n){
    Apoint = 0;
    Bpoint = 0;
    for(i=0; i<n; i++){
      cin >> A[i] >> B[i];
    }
    for(i=0; i<n; i++){
      if(A[i]>B[i])Apoint += A[i]+B[i];
      else if (A[i]<B[i])Bpoint += B[i]+A[i];
      else{
	Apoint += A[i];
	Bpoint += B[i];
      }
    }

    cout << Apoint << " " << Bpoint << endl;
  }
  return 0;
}

Measured memory_bytes: 3164
#include <cstdio>

int A[105][105];
int main(){
    int W, H, N;
    scanf("%d%d%d", &W, &H, &N);

    for (int i=0; i<N; ++i) {
        int x, y, a;
        scanf("%d%d%d", &x, &y, &a);

        if (a == 1) {
            for (int i=0; i<H; ++i)
                for (int j=0; j<x; ++j)
                    A[i][j] = 1;
        }
        else if (a == 2) {
            for (int i=0; i<H; ++i)
                for (int j=x; j<W; ++j)
                    A[i][j] = 1;
        }
        else if (a == 3) {
            for (int i=0; i<y; ++i)
                for (int j=0; j<W; ++j)
                    A[i][j] = 1;
        }
        else if (a == 4) {
            for (int i=y; i<H; ++i)
                for (int j=0; j<W; ++j)
                    A[i][j] = 1;
        }
    }

    int ans = 0;
    for (int i=0; i<H; ++i) {
        for (int j=0; j<W; ++j) {
            ans += A[i][j];
        }
    }

    printf("%d\n", H*W - ans);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

int main(){
    long long A=(long long)pow(2,59),ans=0;
    int n,a;
    cin>>n;
    long long D[300005];
    REP(i,n) cin>>D[i];
    REP(i,60){
        a=0;
        REP(j,n){
            if(D[j]>=A){
                a++;
                D[j]-=A;
            }
        }
        ans=(ans+(((((long long)pow(2,59-i)%MOD)*a)%MOD)*(n-a))%MOD)%MOD;
        A/=2;
    }
    cout<<ans<<endl;
}

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

template<class T>
T lcm(T a,T b){
    return a/__gcd(a,b)*b;
}

int main(){
    long n;cin >> n;
    map<string,long> m;
    for(int i=0;i<n;i++){
        string s;cin >> s;
        sort(&s[0],&s[9]+1);
        m[s]++;
    }
    long ans=0;
    for(auto i:m){
        ans+=i.second*(i.second-1)/2;
    }
    cout << ans;
    return 0;
}

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

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> x(m);
	for (size_t i = 0; i < m; i++)cin >> x.at(i);
	sort(x.begin(), x.end());
	vector<int> gap(m - 1);
	for (size_t i = 0; i < m-1; i++)gap.at(i) = x.at(i + 1) - x.at(i);
	sort(gap.begin(), gap.end());
	int64_t ans = 0;
	if (n >= m)cout << 0 << endl;
	else {
		for (size_t i = 0; i < m - n; i++)ans += gap.at(i);
		cout << ans << endl;
	}
}


Measured memory_bytes: 1024
// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#define _USE_MATH_DEFINES
#include <iostream>
#include<math.h>
#include<iomanip>
using namespace std;

int main()
{
    double a, b, h, m;
    cin >> a >> b >> h >> m;
    //a：時針、b：分針、h時m分

    double x = 0.0;
    double angleA = 0.0;
    double angleB = 0.0;
    double ans = 0.0;

    angleA = (30.0 * h) + (0.5 * m);
    angleB = 6.00 * m;

    if (angleA >= angleB) {
        x = angleA - angleB;
    }
    else if(angleB > angleA) {
        x = angleB - angleA;
    }

    if (x > 180.0) { x = 360.0 - x; }

    if (x == 0.0) {
        if (a >= b) { cout << a - b << endl; }
        else { cout << b - a << endl; }
    }
    else if (x == 180.0) {
        cout << a + b << endl;
    }
    else if (x == 90.0) {
        cout << setprecision(20) << sqrt((a * a) + (b * b)) << endl;
    }
    else if (x < 90.0) {
        if (a >= b) {
             ans = sqrt((a-(cos(x * M_PI/180.0 )*b)) * (a - (cos(x * M_PI / 180.0) * b)) + (sin(x*M_PI/180.0)*b) * (sin(x * M_PI / 180.0) * b));
             cout << setprecision(20) << ans << endl;
        }
        else {
            ans = sqrt((b - (cos(x * M_PI / 180.0) * a)) * (b - (cos(x * M_PI / 180.0) * a)) + (sin(x * M_PI / 180.0) * a) * (sin(x * M_PI / 180.0) * a));
            cout << setprecision(20) << ans << endl;
        }
    }
    else if (x > 90.0) {
        if (a >= b) {
            ans = sqrt((sin((180.0 - x) * M_PI / 180.0) * a) * (sin((180.0 - x) * M_PI / 180.0) * a) + (cos((180.0 - x) * M_PI / 180.0) * a + b) * (cos((180.0 - x) * M_PI / 180.0) * a + b));
            cout << setprecision(20) << ans << endl;
        }
        else {
            ans = sqrt((sin((180.0 - x) * M_PI / 180.0) * b) * (sin((180.0 - x) * M_PI / 180.0) * b) + (cos((180.0 - x) * M_PI / 180.0) * b + a) * (cos((180.0 - x) * M_PI / 180.0) * b + a));
            cout << setprecision(20) << ans << endl;
        }
    }
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します
 

Measured memory_bytes: 4032
n, m = map(int, input().split())
student = []
for _ in range(n):
    student.append([int(x) for x in input().split()])
chkpoint = []
for _ in range(m):
    chkpoint.append([int(x) for x in input().split()])

def dist(a, b):
    return abs(a[0] - b[0]) + abs(a[1] - b[1])

for i in range(n):
    minx = 10**9
    goto = 0
    for j in range(m):
        tmp = dist(student[i], chkpoint[j])
        if minx > tmp:
            minx = tmp
            goto = j+1
    print(goto)
    

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

int main () {
    int N;
    cin >> N;

    bool F=false;

    for (int i=1; i<10; i++) {
        for (int j=1; j<10; j++) {
            if (i*j==N) {
                F=true;
            }
        }
    }
    
    if (F) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x,y,z,m,w,h;
    cin>>x>>y>>z>>m;
    w=x*y;
    h=z*m;
    if(w>h){
    	cout<<w;
	}if(h>=w){
		cout<<h;
		
	}
	
	return 0;
}

Measured memory_bytes: 256
# Problem https://atcoder.jp/contests/abc068/tasks/abc068_b
# Python 2nd Try


def solver(givenNumber):
    answer = 1
    counter = 0
    modCounter = [0] * givenNumber
    for j in range(0, givenNumber):
        eachCounter = 0
        baseNumber = j + 1
        while True:
            if baseNumber % 2 == 0:
                eachCounter = eachCounter + 1
                baseNumber = baseNumber / 2
            else:
                break
        modCounter[j] = eachCounter
    for j in range(0, givenNumber):
        if counter <= modCounter[j]:
            counter = modCounter[j]
            answer = j+1
    return answer


if __name__ == "__main__":
    N = int(input())
    print(solver(N))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
struct Edge { int to, id;};
 
vector<vector<Edge>> g;
vector<int> ans;
 
void dfs(int v, int c=-1, int p=-1) {
  int k = 1;
  rep(i,g[v].size()) {
    int u = g[v][i].to, ei = g[v][i].id;
    if (u == p) continue;
    if (k == c) ++k;
    ans[ei] = k; ++k;
    dfs(u,ans[ei],v);
  }
}
 
int main() {
  int n;
  cin >> n;
  g.resize(n);
  ans = vector<int>(n-1);
  rep(i,n-1) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    g[a].push_back((Edge){b,i});
    g[b].push_back((Edge){a,i});
  }
  dfs(0);
  int mx = 0;
  rep(i,n) mx = max(mx, int(g[i].size()));
  cout << mx << endl;
  rep(i,n-1) {
    cout << ans[i] << endl;
  }
  return 0;
}

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

int n,l;
string s;
vector<string> vct;

int main(){

  while(cin>>n>>l){

      while(n--){
        cin>>s;
        vct.emplace_back(s);
      }

      sort(vct.begin(),vct.end());
      for(auto von: vct)
        cout<<von;

      cout<<endl;

      vct.clear();

  }


return 0;
}


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

int main(void){
    int n, m, x;
    std::cin >> n >> m >> x;
    std::vector<std::vector<int>> t(n, std::vector<int>(m));
    std::vector<int> c(n);
    for(int i = 0; i < n; ++i){
        std::cin >> c[i];
        for(int j = 0; j < m; ++j){
            std::cin >> t[i][j];
        }
    }
    int cost = 0x7fffffff;
    for(int i = 0; i < (int) std::pow(2, n); ++i){
        int tmp = 0;
        std::vector<int> v(m, 0);
        for(int j = 0; j < n; ++j){
            if((i / (int) std::pow(2, j)) % 2 == 1){
                tmp += c[j];
                for(int k = 0; k < m; ++k){
                    v[k] += t[j][k];
                }
            }
        }
        for(int j = 0; j < m; ++j){
            if(v[j] < x) break;
            if(m - 1 == j) cost = std::fmin(cost, tmp);
        }
    }
    std::cout << ((0x7fffffff == cost)? -1 : cost) << std::endl;

    return 0;
}

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

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  int n; cin >> n;
  long long a[n], b[n];
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  long long res = 0;
  for (int i = n - 1; i >= 0; i--) {
    a[i] += res;
    res +=  ((a[i] + b[i] - 1) / b[i]) * b[i] - a[i];
  }
  cout << res << "\n";
  return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>
#include<iostream>

using namespace std;

int N;
int main() {
    cin >> N;
    int cnt = 0;
    for(int i=1;i<=N;i++){
        int x;
        cin >> x;
        if( x != i ) cnt++;
    }
    cout << (cnt <= 2 ? "YES": "NO") << endl; 
    return 0;
}

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

int main()
{
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y;
}

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

using namespace std;
using ll = long long;
int main(){
    int n;ll l;
    cin>>n>>l;
    vector<ll> a(n);
    for(auto & b : a) cin>>b;
    int i;bool pos = false;
    for(i=0;i<n-1;++i){
        if(a[i] + a[i+1] >= l){pos=true;break;}
    }
    if(!pos){
        cout << "Impossible" << endl;
    }else{
        cout << "Possible" << endl;
        for(int j=0;j<i;++j)cout<< j+1 << endl;
        for(int j=n-2;j>i;--j)cout<< j+1 << endl;
        cout<<i+1 << endl;
    }
    return 0;
}


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

#define pb push_back
#define fi first
#define SZ(x) (int((x).size()))
#define se second
#define ll long long
#define pq priority_queue
#define MP make_pair
#define pii pair<int,int>
#define mod 998244353
#define inf 0x3f3f3f3f
#define debug(x) cerr<<#x<<"="<<x<<'\n'
#define rep(i, a, b) for (int i=a; i<(b); i++)

const int maxn=3e3+10;

int n,m;
int a[maxn];
int f[maxn][maxn];

int main(){
    std::ios::sync_with_stdio(false);
    cin>>n>>m;
    f[0][0]=1;
    rep(i,1,n+1) {
		cin>>a[i];
		rep(j,0,m+1) {
			f[i][j]=f[i-1][j]*2%mod;
			if (j-a[i]>=0) (f[i][j]+=f[i-1][j-a[i]])%=mod;
		}
	}
	cout<<f[n][m];
	return 0;
}


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

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

Measured memory_bytes: 3592
#include <iostream>

int main( void )
{
	std::size_t N;
	std::cin >> N;

	if( N == 1 ){
		std::cout << "Hello World" << std::endl;
	}
	else if( N == 2 ){
		int a, b;
		std::cin >> a >> b;

		std::cout << a + b << std::endl;
	}
	else{
	}

	return 0;
}


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

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

using namespace std;

int main()
{
	ll n, q, L, R;
	cin>>n>>q>>L>>R;
	vector<ll> a(n), Q(q), x(q), s(q), t(q);
	rep(i, n) cin>>a[i];
	sort(a.begin(), a.end());
	ll solveL, solveR;
	rep(i, q){
		cin>>Q[i]>>x[i]>>s[i]>>t[i];
	}

	ll left=-1;
	ll right=n;
	//L condition
	while(right-left>1){
		ll mid = (left+right)/2;
		ll ma = a[mid];
		rep(i, q){
			if (Q[i]==1 && ma>=x[i]){
				ma = (ma+s[i])*t[i];
			}else if(Q[i]==2 && ma<=x[i]){
				ma = (ma-s[i])/t[i];
			}
		}
		if (ma>=L){
			right = mid;
		}else{
			left = mid;
		}
	}
	solveL = right;
	left=-1;
	right=n;
	//L condition
	while(right-left>1){
		ll mid = (left+right)/2;
		ll ma = a[mid];
		rep(i, q){
			if (Q[i]==1 && ma>=x[i]){
				ma = (ma+s[i])*t[i];
			}else if(Q[i]==2 && ma<=x[i]){
				ma = (ma-s[i])/t[i];
			}
		}
		if (ma>R){
			right = mid;
		}else{
			left = mid;
		}
	}
	solveR = left;
	cout << solveR-solveL+1 << endl;
	return 0;
}


Measured memory_bytes: 10420
<?php

    while($num = intval(fgets(STDIN))){
        if($num=0)break;
        $array = array_map('intval',explode(" ",trim(fgets(STDIN))));
        $sum = array_sum($array);
        $ave = $sum/count($array);
        $x=0;
        foreach($array as $value){
            $x = $x + pow(($value - $ave),2);
        }
        $a = sqrt($x/count($array));
        
        echo $a."\n";
    }
?>


Measured memory_bytes: 9640
# -*- coding: utf-8 -*-

S = [i for i in input()]
count = 0

if S.pop(0) == 'A':
    count += 1

if S[1:-1].count('C') == 1:
    count += 1
    S.remove('C')

    if ''.join(S).islower():
        count += 1

print('AC' if count == 3 else 'WA')

Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>

using namespace std;

#define int long long
#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using ll=long long;
using vi=vector<int>;
using pii=pair<int, int>;

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
ll read(){ll a;scanf("%lld",&a);return a;}

const int inf = 3 * TEN(18) + 10;
const int mod = 998244353;

int N;
string S;

bool used[26];

signed main()
{
	cin >> N;
	cin >> S;

	int ans = 0;

	for(int i = 1; i < N; ++i) {
		for (int j = 0; j < i; ++j) {
			used[S[j] - 'a'] = true;
		}

		int counter = 0;

		for (int j = i; j < N; ++j) {
			if (used[S[j] - 'a']) {
				counter++;
				used[S[j] - 'a'] = false;
			}
		}

		chmax(ans, counter);
	}

	cout << ans << endl;
}


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

const double EPS = 1e-10;
bool eq(double a, double b) {return fabs(a - b) < EPS;}

struct Point {
    double x, y;
    Point(double x = 0.0, double y = 0.0) : x(x), y(y) {}
    Point operator + (Point &p);
    Point operator - (Point &p);
    Point operator * (double k);
    Point operator / (double k);
    bool operator == (const Point &p) const;
    double norm();
    double abs();
    void input();
} typedef Vec;

double rtod(double r) { return r * 180.0 / acos(-1); }
double dtor(double d) { return d * acos(-1) / 180.0; }

double norm(Vec a);
double abs(Vec a);

double dot(Vec a, Vec b);
double cross(Vec a, Vec b);

double getDistance(Point a, Point b);

int main() {
    int A, B, H, M;
    cin >> A >> B >> H >> M;
    double ax = A * cos(dtor((60 * H + M) / 2.0));
    double ay = A * sin(dtor((60 * H + M) / 2.0));
    double bx = B * cos(dtor(6 * M));
    double by = B * sin(dtor(6 * M));
    Point a(ax, ay), b(bx,by);
    printf("%.15lf\n", getDistance(a, b));
    return 0;
}

Point Point::operator + (Point &p) {return Point(x + p.x, y + p.y);}
Point Point::operator - (Point &p) {return Point(x - p.x, y - p.y);}
Point Point::operator * (double k) {return Point(x * k, y * k);}
Point Point::operator / (double k) {return Point(x / k, y / k);}
bool Point::operator == (const Point &p) const {return eq(x, p.x) && eq(y, p.y);}
double Point::norm() {return x * x + y * y;}
double Point::abs() {return sqrt(norm());}
void Point::input() {double _x, _y; cin >> _x >> _y; x = _x; y = _y;}

double norm(Vec a) {return a.x * a.x + a.y * a.y;}
double abs(Vec a) {return sqrt(norm(a));}

double dot(Vec a, Vec b) {return a.x * b.x + a.y * b.y;}
double cross(Vec a, Vec b) {return a.x * b.y - a.y * b.x;}

double getDistance(Point a, Point b) {return abs(a - b);}


Measured memory_bytes: 4156
# -*- coding: utf-8 -*-

# 入力
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):
        for k in range(C+1):
            if i*500 + j*100 + k*50 == X:
                cnt += 1
print(cnt)

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

int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;

    int ans = 0;
    rep(i, 10) rep(j, 10) rep(k, 10) {
        int cnt = 0;
        rep(l, N) {
            if (cnt == 0 && S[l] == '0' + i) {
                ++cnt;
                continue;
            }
            if (cnt == 1 && S[l] == '0' + j) {
                ++cnt;
                continue;
            }
            if (cnt == 2 && S[l] == '0' + k) {
                ++cnt;
                continue;
            }
        }
        if (cnt == 3) ++ans;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3712