akhauriyash/Code-Regression huggingface dataset:
import sys
input = sys.stdin.readline
rows,cols = list(map(int,raw_input().split()))
grid=[]
up=[]
# down=[]
# left=[]
# right=[]
for i in range(rows):
	grid.append(raw_input())
	up.append([0 for j in range(cols)])
	# down.append([-1 for j in range(cols)])
	# left.append([-1 for j in range(cols)])
	# right.append([-1 for j in range(cols)])
#up
for c in range(cols):
	count = 1
	for r in range(rows-1,-1,-1):
		if(grid[r][c]=='#'):
			count=1
		else:
			up[r][c]+=count
			count+=1

#down

for c in range(cols):
	count = 1
	for r in range(rows):
		if(grid[r][c]=='#'):
			count=1
		else:
			up[r][c]+=count
			count+=1

#left

for c in range(rows):
	count = 1
	for r in range(cols-1,-1,-1):
		if(grid[c][r]=='#'):
			count=1
		else:
			up[c][r]+=count
			count+=1

#right

for c in range(rows):
	count = 1
	for r in range(cols):
		if(grid[c][r]=='#'):
			count=1
		else:
			up[c][r]+=count
			count+=1
ans = 1
for x in range(rows):
	for y in range(cols):
		if(grid[x][y]=='.'):
			ans=max(ans,(up[x][y]-3))
print(ans)

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

int main() {
  int N;
  cin >> N;
  if(N == 1||N == 2||N == 3||N == 5||N == 6||N == 9||N == 10||N == 13||N == 17)cout << "No" << endl;
  else cout << "Yes" << endl;
}


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

#define REP(i, n, m) for(int i = n; i < m; i++)
#define REPR(i, n, m) for(int i = n; i >= m; i--)
#define LREP(i, n, m) for(ll i = n; i < m; i++)
#define LREPR(i, n, m) for(ll i = n; i >= m; i--)

#define P pair<int, int >


const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;

typedef long long ll;


//---functions---//
int gcd(int a, int b){
    if(a < b) swap(a, b);
    return b?gcd(b, a%b):a;
}

int s2i(string num){stringstream ss; ss << num << flush; int n; ss >> n; return n;}
string i2s(int n){stringstream ss; ss << n << flush; return ss.str();}

bool firstCompare(const P& firstElof, const P& secondElof){
    return firstElof.first < secondElof.first;
}
bool secondCompare(const P& firstElof, const P& secondElof){
    return firstElof.second < secondElof.second;
}
//---------------//

ll K, A, B;
int main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    cin >> K >> A >> B;

    if(B - A <= 2 || K <= A - 1){
        cout << K + 1 << endl;
    }else{
        ll ans = A;
        ll res_K = K - (A - 1);
        if(res_K % 2 == 0){
            ans += res_K / 2 * (B - A);
            cout << ans << endl;
        }else{
            ans += (res_K - 1) / 2 * (B - A) + 1;
            cout << ans << endl;
        }
    }

}


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

int n;
long long c,k,t[100010];
int main(){
  std::cin>>n>>c>>k;
  for(int i=0;i<n;++i)
    std::cin>>t[i];
  std::sort(t,t+n);
  
  long long time=0,ans=0;
  int people=0;
  for(int i=0;i<n;++i){
    if(i==0){
      time=t[i]+k;
      ++ans;
    }
    if(time<t[i]||t[i]+k<time||people>=c){
      time=t[i]+k;
      ++ans;
      people=0;
    }
    
    ++people;
  }
  
  std::cout<<ans<<std::endl;
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>

using namespace std;

const int nmax = 8;
bool graph[nmax][nmax];

int dfs(int v, int n, bool visited[nmax])
{
    bool all_visited = true;

    for (int i = 0; i < n; i++){
        if (visited[i] == false) all_visited = false;
    }

    if (all_visited) return 1;

    int ret = 0;

    for (int i = 0; i < n; i++) {
        if (graph[v][i] == false) continue;
        if (visited[i])           continue;

        visited[i] = true;
        ret += dfs(i, n, visited);
        visited[i] = false;
    }

    return ret;
}

int main()
{
    int n, m; cin >> n >> m;

    for (int i = 0; i < m; i++) {
        int a, b; cin >> a >> b;
        graph[a - 1][b - 1] = graph[b - 1][a - 1] = true;
    }
    
    bool visited[nmax];
    for (int i = 0; i < n; i++) {
        visited[i] = false;
    }

    visited[0] = true;
    cout << dfs(0, n, visited) << endl; 

    return 0;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
//container util
//------------------------------------------
#define SIZEOF(x) sizeof(x)/sizeof(x[0])
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;


template <class T>
T max(T *a , LL n){
    T maxi = a[0];
    for(LL i = 0; i < n; ++i){
        if(a[i] > maxi)maxi = a[i];
    }
    return maxi;
}

template <class T>
T maxfrag(T *a , LL n){
    T maxi = a[0];
    T frag = 0;
    for(LL i = 0; i < n; ++i){
        if(a[i] > maxi){
            maxi = a[i];
            frag = i;
        }
    }
    return frag;
}
template <class T>
T min(T *a , LL n){
    T mini = a[0];
    for(LL i = 0; i < n; ++i){
        if(a[i] < mini)mini = a[i];
    }
    return mini;
}
template <class T>
T sum(T *a , LL n){
    T s=0;
    for(LL i = 0; i < n; ++i){
       s+=a[i]; 
    }
    return s;
}

#define MAX(x) max(x,SIZEOF(x))
#define MIN(x) min(x,SIZEOF(x))
#define SUM(x) sum(x,SIZEOF(x))





int main(){
    LL n;
    cin >> n;
    LL a[n];
    REP(i , n){
        cin >> a[i];
    }
    LL fragi = MAX(a);
    LL fragmax = maxfrag(a , SIZEOF(a));
    bool x;

    REP(i , n){
        LL o = a[i];
        a[i] = 0;
        if(i != fragmax){
            cout<<fragi;
        }else{
            cout<<MAX(a);
        }
        if(i!=n-1) cout << "\n";
        a[i] = o;
    }







    return 0;

}


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

const int N = 3005;
char str1[N],str2[N];
int l1,l2;
int dp[N][N];

int rec(int p1,int p2)
{
    if(p1==l1 || p2==l2) return 0;
    int &ret=dp[p1][p2];
    if(ret!=-1) return ret;
    ret=0;
    ret=max(ret,rec(p1+1,p2));
    ret=max(ret,rec(p1,p2+1));
    if(str1[p1]==str2[p2]) ret=max(ret,1+rec(p1+1,p2+1));
    return ret;
}

void path(int p1,int p2)
{
    if(p1==l1 || p2==l2) return ;
    int ret=rec(p1,p2);
    int rt=0;
    rt=rec(p1+1,p2);

    if(rt==ret)
    {
        path(p1+1,p2);
        return;
    }

    rt=rec(p1,p2+1);

    if(rt==ret)
    {
        path(p1,p2+1);
        return;
    }
    rt=1+rec(p1+1,p2+1);
    if(rt==ret)
    {
        printf("%c",str1[p1]);
        path(p1+1,p2+1);
        return;
    }
}


int main()
{
    scanf("%s %s",str1,str2);
    l1=strlen(str1),l2=strlen(str2);
    memset(dp,-1,sizeof dp);
    int ret=rec(0,0);
    path(0,0);
    printf("\n");



}


Measured memory_bytes: 35840
// Aizu Vol0 0034: Railway Lines
// 2017.7.28

#include <stdio.h>
#include <stdlib.h>

#define MAX 11

int main()
{
	int pos[MAX + 5], d;
	int L, v1, v2;
	int i, pq, pr;

	pos[1] = 0;
	while (scanf("%d,", &d) == 1) {
		pos[2] = L = d;
		for (i = 3; i <= MAX; i++) {
			scanf("%d,", &d);
			L += d;
			pos[i] = L;
		}
		scanf("%d,%d", &v1, &v2);
		pq = (L*v1) / (v1 + v2);
		pr = (L*v1) % (v1 + v2);
		for (i = MAX-1; pq < pos[i]; i--);
		if (pq == pos[i] && pr == 0) i--;
		printf("%d\n", i);
	}
	return 0;
}

Measured memory_bytes: 596
#include <stdio.h>
 
using namespace std;
 
int main(){
    int n;
    scanf("%d",&n);
    int A[n];
 
    for(int i = 0; i < n; i++) scanf("%d",&A[i]);
 
    for(int i = n-1; i > 0; i--) printf("%d ",A[i]);
    printf("%d\n",A[0]);
}


Measured memory_bytes: 2616
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
using namespace std;

typedef long long ll;

const int maxn = 400;

int n, K, mod;

int f[maxn][maxn] = {0};
int sum[maxn][maxn] = {0};
int C[maxn][maxn] = {0};

void init() {
	C[0][0] = 1;
	for (int i = 1; i < maxn; ++i) {
		C[i][0] = 1;
		for (int j = 1; j < maxn; ++j) {
			C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
		}
	}
}

int main()
{
	ios::sync_with_stdio(0);
	cin >> n >> K >> mod;
	for (int i = K; i >= 0; --i) {
		f[1][i] = 1;
		sum[1][i] = (sum[1][i + 1] + f[1][i]) % mod;
	}
	init();
	for (int i = 2; i <= n + 1; ++i) {
		for (int j = K; j >= 0; --j) {
			for (int k = 1; k < i; ++k) {
				f[i][j] += (ll)f[k][j] * sum[i - k][j + 1] % mod * C[i - 2][k - 1] % mod;
				f[i][j] %= mod;
				sum[i][j] = (sum[i][j + 1] + f[i][j]) % mod;
			}
		}
	}
	cout << f[n + 1][0] << endl;
	return 0;
}

Measured memory_bytes: 1792
n,m=map(int,input().split())
h=list(map(int,input().split()))
good=[1]*n
for _ in range(m):
	a,b=map(int,input().split())
	a-=1;b-=1
	if h[a]<=h[b]:
		good[a]=0
	if h[b]<=h[a]:
		good[b]=0
print(good.count(1))


Measured memory_bytes: 20004
//inlclude before define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
#include<deque>
#include<iomanip>
#include<set>
#include<unordered_set>
#include<tuple>
#include<map>
#include<memory>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<double> VD;
typedef pair<int, int> P1;
typedef long long int ll;

//number
#define INF 1e9
#define NUM 1000000007

//itr
#define all(x) begin(x),end(x)

//repeat
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,a,b) for(int i=int(a);i<int(b);i++)
#define RREPS(i,x) for(int i=((int)(x));i>=0;i--)

//max,min
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))

//function

/*ll gcd(ll a, ll b) {
	if (b == 0) return a;
	else return gcd(b, a%b);
}*/

/*ll lcm(ll a,ll b) {
	ll g = gcd(a, b);
	return a * (b / g);
}*/

/*int dig(int a) {
	int sum = 0;
	while (a) {
		sum += a % 10;
		a /= 10;
	}
	return sum;
}*/

//grid template
int x[] = { -1, 0, 1, 0 };
int y[] = { 0,-1,0,1 };
int xx[] = { -1,-1,1,1 };
int yy[] = { 1,-1,1,-1 };

int main() {
	int n, m;
	cin >> n >> m;
	map<int, int> mp;

	int a,b;
	rep(i, n) {
		cin >> a;
		rep(j, a) {
			cin >> b;
			mp[b]++;
		}
	}

	int ans = 0;
	for (const auto& x : mp) {
		if (x.second == n) {
			ans++;
		}
	}
	cout << ans << endl;
}


 

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <climits>
#include <vector>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string.h>
#include <iomanip>
using namespace std;
#define int long long
#define ull unsigned long long
#define F first
#define S second
#define nl "\n"
#define ld long double
#define div 1000000007
#define pi 3.14159265358979323846
#define pb push_back

void solve()
{
    int n;cin>>n;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        int x;cin>>x;
        if(i&1 && (x&1))
            ans++;
    }
    cout<<ans<<nl;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

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


Measured memory_bytes: 3636
import sys
input = lambda : sys.stdin.readline().rstrip()
mod = 10**9 + 7

n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))
a = set(a)
dp = [0]*(n + 1)
dp[0] = 1
for i in range(n):
    if i + 2 not in a and i + 2 <= n:
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod
    if i + 1 not in a:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
print(dp[-1])

Measured memory_bytes: 13216
#include<cstdio>
#include<algorithm>
#include<queue>
using namespace std;
const int N=1e6+10;
int n,m,I[110][110],O[110][110],r[110],c[110],cnt;
char s[110][110];
struct edge{int f,t,g;}w[N];
int S,T,head[N],nxt[N];
void add(int f,int t,int g){
	static int cnt=1;
	w[++cnt]=(edge){f,t,g};
	nxt[cnt]=head[f];
	head[f]=cnt;
	w[++cnt]=(edge){t,f,0};
	nxt[cnt]=head[t];
	head[t]=cnt;
}
struct st{
	int x,i,df;
	st(int X=0,int DF=0){x=X;i=head[x];df=DF;}
}z[N];
int l[N],top,flow;
#define V z[top].x
#define E z[top].i
#define F z[top].df
void change(){
	int df=F;flow+=df;
	for (int i=top-1;i;i--){
		w[z[i].i].g-=df;
		w[z[i].i^1].g+=df;
		z[i].df-=df;
		if (!z[i].df) top=i;
	}
}
queue<int> Q;
void bfs(){
	for (int i=1;i<=cnt;i++) l[i]=0;
	l[S]=1;Q.push(S);
	while (!Q.empty()){
		int v=Q.front();Q.pop();
		for (int i=head[v];i;i=nxt[i])
		if (w[i].g&&!l[w[i].t]) l[w[i].t]=l[v]+1,Q.push(w[i].t);
	}
}
bool dinic(){
	bfs();
	if (!l[T]) return 0;
	z[top=1]=st(S,1e9);
	while (top){
		if (V==T) change(),top--,E=nxt[E];else
		if (!E) l[V]=0,top--,E=nxt[E];else
		if (w[E].g&&l[w[E].t]==l[V]+1)
			z[top+1]=st(w[E].t,min(w[E].g,F)),top++;
		else E=nxt[E];
	}
	return 1;
}
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++) scanf("%s",s[i]+1);
	for (int i=1;i<=n;i++) r[i]=++cnt;
	for (int j=1;j<=m;j++) c[j]=++cnt;
	for (int i=1;i<=n;i++)
	for (int j=1;j<=m;j++)
	if (s[i][j]!='.'){
		I[i][j]=++cnt;
		O[i][j]=++cnt;
		add(I[i][j],O[i][j],1);
		add(O[i][j],r[i],1e9);
		add(r[i],I[i][j],1e9);
		add(O[i][j],c[j],1e9);
		add(c[j],I[i][j],1e9);
		if (s[i][j]=='S') S=O[i][j];
		if (s[i][j]=='T') T=I[i][j];
	}
	while (dinic());
	printf("%d\n",flow<1e9?flow:-1);
	return 0;
}

Measured memory_bytes: 20992
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

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

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

#[allow(unused)]
use std::cmp::{max, min};
#[allow(unused)]
use std::collections::HashMap;

#[allow(unused)]
fn gcd(x: i64, y: i64) -> i64 {
    if y == 0 {
        x
    } else {
        gcd(y, x % y)
    }
}

#[allow(unused)]
fn lcm(x: i64, y: i64) -> i64 {
    x * y / gcd(x, y)
}

fn main() {
    input! {
        // usize
        // n: usize,
        // vec
        // v: [i64; n],
        r: i64,
        d: i64,
        x: i64,
    }

    let mut vec = vec![0; 11];
    vec[0] = x;
    for i in 1..11 {
        vec[i] = vec[i - 1] * r - d;
        println!("{}", vec[i]);
    }
}


Measured memory_bytes: 4352
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std ;

const char *STR="AKIHABARA";
string s;

int main(){
	cin>>s;
	if (s=="AKIHABARA"||
		s=="KIHABARA" ||
		s=="AKIHBARA" ||
		s=="AKIHABRA" ||
		s=="AKIHABAR" ||
		s=="KIHBARA" ||
		s=="KIHABRA" ||
		s=="KIHABAR" ||
		s=="AKIHBRA" ||
		s=="AKIHBAR" ||
		s=="AKIHABR" ||
		s=="KIHBRA" ||
		s=="KIHBAR" ||
		s=="KIHABR" ||
		s=="AKIHBR" ||
		s=="KIHBR") puts("YES") ;
	else puts("NO");
	return 0 ;
}

Measured memory_bytes: 256
i = gets.to_i
sum = 0
count =0

(1..i).each do |n|
    if n %2 ==0
        next
    end
    (1..n).each do |k|
        
        if n%k == 0
            count +=1
          if count == 8
            sum +=1
           next 
          end
        end
    end
    count=0
end
puts sum

Measured memory_bytes: 1788
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int F[1010][10];
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < 10; j++) {
            cin >> F[i][j];
        }
    }
    int P[1010][11];
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < 11; j++) {
            cin >> P[i][j];
        }
    }
    int ans = -INF; 
    for(int bit = 1; bit < (1 << 10); bit++) {
        int score = 0;
        for(int i = 0; i < N; i++) {
            int match = 0;
            for(int j = 0; j < 10; j++) {
                if (bit & (1 << j) && F[i][j]) {
                    match++;
                }
            }
            score += P[i][match];
        }
        ans = max(ans, score);
    }
    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <list>
#include <numeric>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;

int a, b, c;
string s, t;

int main()
{
	a = 0;
	cin >> a ;
	vector<string> u(a);
	vector<int> x(a);
	rep(i,a)
	{
		cin >> u.at(i)>> x.at(i);
	}
	cin >> t;

	int i = 0, sum = 0;
	while (i < a)
	{
		if (u.at(i) == t)
		{
			for (int j = i + 1; j < a; j++)
				sum += x.at(j);
			break;
		}
      i++;
	}	
	cout << sum << endl;
}


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


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	string t;
	cin>>t;
	string last;
	int ans=0;
	for(int i=0;i<(int)t.size();++i) {
		string curr(1, t[i]);
		if(last==curr) {
			if(i==(int)t.size()-1) {
				curr=last+curr;
				last=curr;
				//cerr<<last<<"\n";
				break ;
			} else {
				curr.push_back(t[i]);
				i++;
			}
		}
		ans++;
		last=curr;
		//cerr<<last<<"\n";
	}
	
	cout<<ans<<"\n";
	
	return 0;
}


Measured memory_bytes: 720
a,b = map(str, input().split())

x=a*int(b)
y=b*int(a)

keta=min(len(x),len(y))

if int(x[:keta]) > int(y[:keta]):
    print(y)
elif int(x[:keta]) < int(y[:keta]):
    print(x)
else:
    print(x)

Measured memory_bytes: 3060
import math

def primeCheck(n):
    if n == 2:
        return n
    else:
        mx = math.ceil(n ** 0.5)
        for i in range(2, mx + 1):
            if n % i == 0:
                return -1
                break
            elif i == mx:
                return n

n = int(input())

fct = []

for i in range(2, n + 1):
    if primeCheck(i) == -1:
        continue
    else:
        mu = 0
        for j in range(1, 20):
            if n >= i ** j:
                mu += n // (i ** j)
            else:
                fct.append(mu)
                break

ans = 1
for k in range(len(fct)):
    ans *= fct[k] + 1

print(ans % (10**9 + 7))

Measured memory_bytes: 3316
num_list = input()
num_list = num_list.split(' ')

temp = num_list[1] # temporarily save B
num_list[1] = num_list[0] # put A in B
num_list[0] = temp # put B in A
 
temp = num_list[0] # temporarily save A
num_list[0] = num_list[2] # put C in A
num_list[2] = temp # put A in C
 
print(' '.join(num_list))

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

/*アウト：
 フラグが立ってるのに違う数字の時
 ３桁なら、100の位が0指定
 2桁なら、10の位が0指定
 
 あとは指定場所以外全部1でいける
*/
int main(){
  int n, m;
  cin >> n >> m;
  vector<int> vec(n, -1);
  vector<bool> flag(n, false);
  for(int i=0; i<m; i++){
    int fromleft, num;
    cin >> fromleft >> num;
    if(flag[fromleft-1]){
      if(vec[fromleft-1] != num){
        cout << -1 << endl;
        return 0;
      }
    }else{
      flag[fromleft-1] = true;
      vec[fromleft-1] = num;
    }
  }
  if((n == 3 && vec[0] == 0) || (n == 2 && vec[0] == 0)){
    cout << -1 << endl;
    return 0;
  }else{
    if(n == 3){
      if(vec[0] == -1) cout << 1;
      else cout << vec[0];
      for(int i=1; i<n; i++){
        if(vec[i] == -1){
          cout << 0;
        }else{
          cout << vec[i];
        }
      }
      return 0;
    }else if(n == 2){
      if(vec[0] == -1) cout << 1;
      else cout << vec[0];
      for(int i=1; i<n; i++){
        if(vec[i] == -1){
          cout << 0;
        }else{
          cout << vec[i];
        }
      }
      return 0;
    }else if(n == 1){
      if(vec[0] == -1){
        cout << 0;
      }else{
        cout << vec[0];
      }
      return 0;
    }
  }
}
    
  

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	int K=in();
	queue<ll> Q;
	REP(i,9) Q.push(i+1);

	K--;
	LOOP(K){
		auto V=Q.front();
		Q.pop();
		ll X=V%10LL;
		if(X!=0LL) Q.push(V*10LL+(X-1LL));
		Q.push(V*10LL+X);
		if(X!=9LL) Q.push(V*10LL+X+1LL);
	}
	out(Q.front());
	return 0;
}


Measured memory_bytes: 1792
#define ENABLE_DEBUG 1
// Kana's kitchen {{{
#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
#define LOOP(k) for(i64 ngtkana_is_a_genius=0; ngtkana_is_a_genius<(i64)k; ngtkana_is_a_genius++)

using i32 = std::int_least32_t;
using i64 = std::int_least64_t;
using u32 = std::uint_least32_t;
using u64 = std::uint_least64_t;
using usize = std::size_t;

template <class T, class U> using pair = std::pair<U, T>;
template <class T> using diag_pair = std::pair<T, T>;
template <class... Args> using tuple = std::tuple<Args...>;
template <class T> using vec = std::vector<T>;
template <class T> using numr = std::numeric_limits<T>;

#ifdef NGTKANA
#include<debug.hpp>
#else
#define DEBUG(...)(void)0
#endif
/*}}}*/

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15) << std::fixed;

    i32 n, k, x, y;
    std::cin >> n >> k >> x >> y;
    std::cout << n * x + std::max(i32{0}, n - k) * (y - x) << '\n';
}


Measured memory_bytes: 256
// Author -- Frame

#include<bits/stdc++.h>

#define lowbit(x) ((x)&(-x))
#define Finline __inline__ __attribute__ ((always_inline))
#define DEBUG fprintf(stderr,"Running on Line %d in Function %s\n",__LINE__,__FUNCTION__)
#define SZ(x) ((int)x.size())
#define mkpr std::make_pair
#define pb push_back

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef std::pair<int,int> pi;
typedef std::pair<ll,ll> pl;

const int inf=0x3f3f3f3f,Inf=0x7fffffff;
const ll INF=0x3f3f3f3f3f3f3f3f;

Finline uint rnd()
{
	static uint seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
template <typename _Tp>_Tp gcd(const _Tp &a,const _Tp &b){return (!b)?a:gcd(b,a%b);}
template <typename _Tp>Finline _Tp abs(const _Tp &a){return a>=0?a:-a;}
template <typename _Tp>Finline _Tp max(const _Tp &a,const _Tp &b){return a<b?b:a;}
template <typename _Tp>Finline _Tp min(const _Tp &a,const _Tp &b){return a<b?a:b;}
template <typename _Tp>Finline void chmax(_Tp &a,const _Tp &b){(a<b)&&(a=b);}
template <typename _Tp>Finline void chmin(_Tp &a,const _Tp &b){(b<a)&&(a=b);}
template <typename _Tp>Finline void read(_Tp &x)
{
	char ch(getchar());
	bool f(false);
	while(ch<48||ch>57) f|=ch==45,ch=getchar();
	x=ch&15,ch=getchar();
	while(ch>=48&&ch<=57) x=(((x<<2)+x)<<1)+(ch&15),ch=getchar();
	if(f) x=-x;
}
template <typename _Tp,typename... Args>Finline void read(_Tp &t,Args &...args){read(t);read(args...);}
Finline int read_str(char *s)
{
	char ch(getchar());
	while(ch==' '||ch=='\r'||ch=='\n') ch=getchar();
	char *tar=s;
	*tar=ch,ch=getchar();
	while(ch!=' '&&ch!='\r'&&ch!='\n'&&ch!=EOF) *(++tar)=ch,ch=getchar();
	return tar-s+1;
}

const int N=19;
std::map<pl,ll> dp[N][N];
ll a[N];
ll dfs(int l,int r,ll cl,ll cr)
{
	if(l>r) return 0;
	pl tmp=mkpr(cl,cr);
	if(dp[l][r].find(tmp)!=dp[l][r].end()) return dp[l][r][tmp];
	ll ans=1e18;
	for(int i=l;i<=r;++i) chmin(ans,dfs(l,i-1,cl,cl+cr)+dfs(i+1,r,cl+cr,cr)+(cl+cr)*a[i]);
	return dp[l][r][tmp]=ans;
}
int main()
{
	int n;
	read(n);
	for(int i=1;i<=n;++i) read(a[i]);
	printf("%lld\n",dfs(2,n-1,1,1)+a[1]+a[n]);
	return 0;
}


Measured memory_bytes: 20072
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define infi 1900000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vs = vector<string>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vvp = vector<vector<pair<int,int>>>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;
template<typename T> bool chmax(T &a, T b) {if(a < b) {a = b;return 1;}return 0;}
template<typename T> bool chmin(T &a, T b) {if(a > b) {a = b;return 1;}return 0;}




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

    
    int N,M;
    cin >> N >> M;
    int sum = 0;
    rep(i,M){
        int a;
        cin >> a;
        sum += a;
    }
    
    if(N < sum) cout << -1 << endl;
    else cout << N-sum << endl;
    

    return 0;
}


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

using namespace std;

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

#define REP(i, n) for(int i = 0; i < n; ++i)

template<class T>
T read() {
    T x{};
    cin >> x;
    return x;
}

template<class T>
vector<T> read(int N){
    vector<T> x(N);
    for(int i = 0; i < N; ++i){
        cin >> x[i];
    }
    return x;
}

template<class T>
void write(const T &x){ cout << x << endl; }

int main(){
  ll N;
  cin >> N;
  
  ll M = (ll)sqrt(N);
  ll ans = 1LL << 62;
  for(ll i = 1; i <= M; ++i){
    if(N % i == 0) ans = min(ans, N / i + i - 2);
  }
  cout << ans << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int N;
vp a;

int main(){
	cin>>N;
	a=vp(N);
	int num,v;
	for(int i=0;i<N;i++){
		cin>>num>>v;
		a[i]=P(v,-num);
	}
	sort(a.begin(),a.end());
	P ans=a.back();
	cout<<-ans.second<<' '<<ans.first<<endl;
	
}

Measured memory_bytes: 1200
n=int(input())
a=list(map(int,input().split()))
a.sort()
plus=[a[n-1]]
minus=[a[0]]
for i in range(1,n-1):
	if a[i]>=0:
		plus.append(a[i])
	else:
		minus.append(a[i])
print(sum(plus)-sum(minus))
k=minus[-1]
for i in range(len(plus)-1):
	print(k,plus[i+1])
	k-=plus[i+1]
t=plus[0]
for i in range(len(minus)-1):
	print(t,minus[i])
	t-=minus[i]
print(t,k)

Measured memory_bytes: 14144
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}


func main() {
    let n = readInt()
    let aryP = readInts()
    //_________________________ここまで入力
    
    /// 最小値
    var m = Int.max
    var ans = 0
    for i in 0..<n {
        if aryP[i] <= m {
            m = aryP[i]
            ans += 1
        }
    }
    print(ans)
}

main()





Measured memory_bytes: 23556
#include<bits/stdc++.h>
using namespace std;
 
int main()
{
	unsigned long long h,w;
    cin>>h>>w;
  
    if(h==1 || w==1)
		cout<<"1";
    else
     {
       	if( (h*w)%2==0)
      		cout<<h*w/2;
    	else
      		cout<<(h*w)/2+1;
     }
    return 0;
}

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

int n,dp[30];
const int mod=1000000007;
string s1,s2;

int main(){
	cin>>n;
	cin>>s1>>s2;
	if (n==1){
		cout<<3<<endl;
		return 0;
	}
	dp[0]=dp[1]=2;
	for (int i=2;i<=27;i++){
		dp[i]=dp[i-1]*3;
		dp[i]%=mod;
	}
	int head=1,k=0,i=0;
	long long ans=1;
	if (s1[0]!=s1[1]){
		i++;
		ans=3;
		head=0;
	}
	for (;i<n;i++){
		if (s1[i]==s1[i+1]){
			i++;
			k++;
		}
		else{
			ans*=dp[k+head];
			//cout<<k+head<<endl;
			head=0;
			k=0;
			ans%=mod;
		}
	}
	if (s1[n-1]==s1[n-2]) ans*=dp[k+head];
	ans%=mod;
	cout<<ans<<endl;
	return 0;
}

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

int main() {
	int a, b;
	cin >> a >> b;
	if (a + b >= a*b&&a + b >= a - b) cout << a + b << endl;
	else if (a*b >= a + b&&a*b >= a - b) cout << a*b << endl;
	else if (a - b >= a + b&&a - b >= a*b) cout << a - b << endl;
	return 0;
}

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

const int mnx = 1e6 + 9;
const int mod =  1e9 + 7;

ll n;
ll a[mnx];
ll mn = mnx, mx, cmx, cm1;

int main(){

cin >> n;

for(int i = 0; i < n; i++){
    cin >> a[i];
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
}

if(mx - mn <= 1){
    for(int i = 0; i < n; i++){
        cmx += (a[i] == mx);
        cm1 += (a[i] == mx - 1);
    }
    if(cmx == 1){ cout << "No" << '\n'; return 0; }
    if(!cm1 && mx == n - 1){ cout << "Yes" << '\n'; return 0;}
    ll l = cm1 + 1;
    ll r = cm1 + (n - cm1) / 2;
    if(mx >= l && mx <= r) cout << "Yes" << '\n';
    else cout << "No" << '\n';
}

else cout << "No" << '\n';

return 0;

}














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

namespace ABC141B
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));

            return;
        }

        public void Solve(ConsoleInput cin)
        {

            var S = cin.ReadLine.ToCharArray();
            bool fg = true;

            if (S.Length == 1)
            {
                if(S[0] == 'L')
                {
                    Console.WriteLine("No");
                }
                else
                {
                    Console.WriteLine("Yes");
                }
                return;
            }

            for (int i = 0; i < S.Length; i += 2)
            {
                if (S[i] == 'L') fg = false;
            }
            for (int i = 1; i < S.Length; i += 2)
            {
                if (S[i] == 'R') fg = false;
            }

            if (fg)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }

        }
    }

    public static class Extensions
    {
        public static string Reverse(this string sourse)
        {
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 13268
class Program
{
  static void Main(string[] args)
  {
    string a = System.Console.ReadLine();
    string[] b = a.Split(' ');
    int x = int.Parse(b[0]);
    int y = int.Parse(b[1]);
    if(x<y)
    {
        int tmp = x;
        x=y;
        y=tmp;
    }
    
    for(int l=0; l<x; l++) System.Console.Write(y.ToString());
  }
}

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




int main(){
  int n; cin>>n;
  map<string,int> mp;
  rep(i,n){
    string s;
    cin>>s;
    mp[s]++;
  }
  int a=0; //最大値を求める

  for(auto p : mp) a=max(a,p.second);
  for(auto p : mp){
    if(p.second != a) continue;
    cout<<p.first<<endl;
  }  


  
  
}

Measured memory_bytes: 25216
/*
*          Name : chaitanya
*
*     Institute : ANITS,Visakhapatnam
*
*/
#include<cstdio>
#include<iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include<cstring>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#include <random>
#define inf  1000000000
#define all(x) begin(x),end(x)
#define ll long long int
#define ff first
#define ss second
#define pb push_back
const ll mod = 1000000007;
#pragma GCC optimization ("O3")
const int N = 100005;
using namespace std;

int main()
{
 
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  //ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  ll n,m,ans =0;
  cin >> n >> m;
  priority_queue <ll> pq;
  for (int i = 0; i < n ; ++i)
  {
    int a;
    cin >> a;
    pq.push(a);
  }
  for (int i = 0; i < m; ++i)
  {
    int b;
    b =pq.top();
    pq.pop();
    b = b/2;
    pq.push(b);
  }
  while(!pq.empty())
  {
    ans += pq.top();
    pq.pop();
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1400
#include<stdio.h>
#include<math.h>

int main(){
  double r,area,round;

  scanf("%lf",&r);

  area = M_PI * (r*r);
  round = 2 * M_PI *r;

  printf("%lf %lf\n",area,round);

  return 0;
}
  
  

Measured memory_bytes: 648
#include <bits/stdc++.h>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#define pb push_back
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0);cout<<fixed<<setprecision(16);
#define ll long long int
#define ld long double
#define el '\n'
#define El '\n'
#define PI (ld)3.141592653589793238462643383279502884197169399375105820974944
#define inf (ll)1000000000
#define mod (ll)1000000007
#define mod1 (ll)998244353
#define fo(i, n) for (long long i = 0; i < n; i++)
#define pll pair<ll, ll>
#define ml map<ll,ll>
#define vpl vector<pll>
#define vvl vector<vector<ll> >
#define vvpl vector< vector<pll> >
#define ff first
#define ss second
#define pqueue priority_queue< ll >
#define pdqueue priority_queue< ll,vl ,greater< ll > >
#define mem(a,b) memset(a,b,sizeof(a));
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define sz(a) (ll)a.size()
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define vl vector<ll>
//#define x ff
//#define y ss
#define pt(a) for(auto it:a)cout<<it<<" ";cout<<endl;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
using namespace std;

// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << t<<" "; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << v.first << " " << v.second ; }

double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }

long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)

      res = res * a % m;
      a = a * a % m;
      b >>= 1;
  }
  return res;
}


ll kv;
ll t,n,x,y,h,k,z,p,q,w,r;
string s,s1,s2;
//vvl v;
//vl vis,d;


int main() {
    IOS;
    cin>>t;
    cout<<t*t;

    return 0;
}



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

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main() {
  int64_t n, a, b;
  const int N = 1000000007;
  cin >> n >> a >> b;
  int64_t n2 = modpow(2, n, N);
  int64_t nf = 1;
  int64_t af=1, bf=1, uaf=1, ubf=1;
  int nma = n-a, nmb = n-b;
  for(int i=1; i<=a; i++){
    uaf = uaf * (n - i + 1) % N;
    af = af * i % N;
  }
  for(int i=1; i<=b; i++){
    ubf = ubf * (n - i + 1) % N;
    bf = bf * i % N;
  }
  af = modpow(af, N-2, N);
  bf = modpow(bf, N-2, N);
  //cout << n2 << " " << nf << " "<< af << " "<< maf << " "<< bf << " "<< mbf << " ";
  int ans = n2 - 1;
  ans = ans - (uaf * af % N);
  if(ans < 0) ans += N;
  ans = ans - (ubf * bf % N);
  if(ans < 0) ans += N;
  cout << ans << endl;
}



Measured memory_bytes: 256
from collections import Counter
def check():
  H, W = map(int, input().split())
  A = []
  for i in range(H):
    A.extend(list(input()))
  c = Counter(A)
  one = 0
  two = 0
  for v in c.values():
    if v%2==1:
      one += 1
    if v%4==2:
      two += 1
  if H%2==0 and W%2==0:
    if one+two>0:
      return 'No'
  if H%2==0 and W%2==1:
    if two>H//2 or one>0:
      return 'No'
  if H%2==1 and W%2==0:
    if two>W//2 or one>0:
      return 'No'
  if H%2==1 and W%2==1:
    if two>W//2+H//2 or one>1:
      return 'No'
  return 'Yes'
print(check())

Measured memory_bytes: 68016
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
typedef long long ll;
using namespace std;

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }

int main()
{
    ll N; cin >> N;
    vector<ll> A(5);
    ll mi = 1LL<<60;
    for (int i = 0; i < 5; ++i) cin >> A[i], mi = min(mi, A[i]);
    cout << (N + mi - 1) / mi + 4 << endl;
}


Measured memory_bytes: 504
N = int(input())

a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))

c = 0
bb = 0
for i in range(N):
    a = a_list[i]
    b = b_list[i]

    aa = a - bb
    if aa <= 0:
        c += a
        aa = 0
    else:
        c += bb

    if b <= aa:
        c += b
        bb = 0
    else:
        c += aa
        bb = b - aa

aa = a_list[-1] - bb
if aa <= 0:
    c += a_list[-1]
    aa = 0
else:
    c += bb

print(c)

Measured memory_bytes: 18476
#include <string>
#include <iostream>
using namespace std;
int main(void){
    string s;
    cin >> s;
    for(int i =0; i < s.size(); i++){
        if((i+1)%2){
            if(!(s[i] == 'R' || s[i] == 'U' || s[i] == 'D')){
                cout << "No" << endl;
                return 0;
            }
        }else{
            if(!(s[i] == 'L' || s[i] == 'U' || s[i] == 'D')){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
using namespace std;
int main(){	
	ios_base::sync_with_stdio(0);
	long double a;
	cin >> a;
	
	long long rand = a/2;
	
	long long odd = a-rand;
	long double x=odd/a;
	
	cout << fixed << setprecision(10) << odd/a << '\n';
}

Measured memory_bytes: 256
const BKRT = "\n";
const SPAC = " ";
const NOSP = "";

function Main(input){
	input = [].concat(...input.split(BKRT).map(a=>a.split(SPAC)));
  const strShift = ()=>input.shift();
  const intShift = ()=>~~input.shift();
  
  return intShift()%500<=intShift()?"Yes":"No"
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
2018
218
`);

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

#include <math.h>
#include <stdlib.h>


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

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

// const int INF = 1001001001;
// long long max => LLONG_MAX

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    int n; cin >> n;
    string s; cin >> s;
    string ans = "";
    
    int cnto = 0;
    int cntc = 0;
    int pos = n-1;
    while(pos >=0){
        if(s[pos] == ')'){
            cntc++;
        } else {
            if(cntc>0) cntc--;
            else cnto++;
        }
        pos--;
    }
    ans = s;
    for(int i = 0; i < cnto; i++){
        ans += ")";
    }

    pos = 0;
    cnto = 0;
    cntc = 0;
    while(pos < n){
        if(s[pos] == '('){
            cnto++;
        } else {
            if(cnto>0) cnto--;
            else cntc++;
        }
        pos++;
    }
    for(int i = 0; i < cntc; i++){
        ans = "(" + ans;
    }

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


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define str to_string
#define endl "\n"
#define PI 3.141592653589
using namespace std;
using lint = long long;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

//AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC
int main(){
    string s;cin>>s;
    int tmp=count(all(s),'x');
    if(tmp>=8)cout<<"NO"<<endl;
    else cout<<"YES"<<endl;
}


Measured memory_bytes: 3572
n = int(input())
h = list(map(int, input().split()))

dp = [0] * n
dp[1] = abs(h[1] - h[0])
for i in range(2, n):
    dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))

print(dp[n-1])

Measured memory_bytes: 13928
#include <stdio.h>

#define MAX 10000
#define NIL -1

struct Node {int p, l, r;};
struct Node T[MAX];
int n;

void preParse(int u) {
  if(u == NIL) return;
  printf(" %d",u);
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u) {
  if(u == NIL) return;
  inParse(T[u].l);
  printf(" %d",u);
  inParse(T[u].r);
}

void postParse(int u) {
  if(u == NIL) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf(" %d",u);
}

int main(void) {
  int i, v, l, r, root;
  scanf("%d",&n);
  for(i=0; i<n; i++) {
    T[i].p = NIL;
  }
  
  for(i=0; i<n; i++) {
    scanf("%d %d %d",&v,&l,&r);
    T[v].l = l;
    T[v].r = r;
    if(l != NIL) T[l].p = v;
    if(r != NIL) T[r].p = v;
  }
  
  for(i=0;i<n;i++) if(T[i].p == NIL) root = i;
  
  printf("Preorder\n");
  preParse(root);
  printf("\n");

  printf("Inorder\n");
  inParse(root);
  printf("\n");

  printf("Postorder\n");
  postParse(root);
  printf("\n");

  return 0;
}




Measured memory_bytes: 2048