akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repp(i, n, m) for(int (i) = (n); (i) < (m); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define ldou long double
#define fi first
#define se second
#define setpre(x) std::cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ std::cout << " [LOGGER] " << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , "; logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 200005;

/* ...o(^-^)o... */

vector<int> to[MAX];
bool seen[MAX];

int dfs(int s){
    seen[s] = true;
    int tmp = 1;
    for(auto t : to[s]){
        if(seen[t]) continue;
        tmp += dfs(t);
    }
    return tmp;
}

int main(){
    int n,m; cin >> n >> m;
    rep(i, m){
        int a, b; cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }

    int ans = 0;
    rep(i, n){
        if(seen[i]) continue;
        seen[i] = true;
        int connect = dfs(i);
        ans = max(connect, ans);
    }
    out(ans);
}

Measured memory_bytes: 24088
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using VI = vector<int>;
using VVI = vector<VI>;

int N = 1 << 18;
VI st(2 * N - 1);
int query(int a, int b, int k = 0, int l = 0, int r = N) {
  if (r <= a or b <= l) return 0;
  if (a <= l and r <= b) return st[k];
  return query(a, b, 2 * k + 1, l, (l + r) / 2) + query(a, b, 2 * k + 2, (l + r) / 2, r);
}
void add(int k) {
  k += N - 1;
  st[k]++;
  while (k > 0) {
    k = (k - 1) / 2;
    st[k]++;
  }
}

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  int n, k; cin >> n >> k;
  VI a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] -= k;
  }
  vector<lint> c(n + 1);
  vector< pair<lint, int> > p(n + 1);
  p[0] = make_pair(c[0], 0);
  for (int i = 0; i < n; i++) {
    c[i + 1] = c[i] + a[i];
    p[i + 1] = make_pair(c[i + 1], i + 1);
  }
  sort(p.begin(), p.end());
  VI b(n + 1);
  for (int i = 0; i < n + 1; i++) {
    b[i] = p[i].second;
  }
  lint res = 0;
  add(b[0]);
  for (int i = 1; i <= n; i++) {
    res += query(0, b[i]);
    add(b[i]);
  }
  cout << res << '\n';
  return 0;
}

Measured memory_bytes: 9344
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n,m;
vector<int> G[100001];
set<int> rG[100001];
bool used[100005];
int ans[100005];
int cnt=0;

void dfs(int v,int p){
    for(int i=0;i<G[v].size();i++){
        rG[G[v][i]].erase(v);
    }
    for(int i=0;i<G[v].size();i++){
        //printf("%d %d\n",(int)G[v][i],(int)rG[G[v][i]].size());
        if(rG[G[v][i]].size()==0 && ans[G[v][i]]==0){
            ans[G[v][i]]=v+1;
            dfs(G[v][i],v);
        }
    }
}

int main(void){
    scanf("%d%d",&n,&m);
    for(int i=0;i<n+m-1;i++){
        int a,b;
        scanf("%d%d",&a,&b);
        a--;
        b--;
        G[a].push_back(b);
        rG[b].insert(a);
    }
    int v=-1;
    for(int i=0;i<n;i++){
        if(rG[i].size()==0)v=i;
    }
    dfs(v,-1);
    for(int i=0;i<n;i++){
        printf("%d\n",ans[i]);
    }
    return 0;
}


Measured memory_bytes: 25472
#include <iostream>
using namespace std;
int main(void){
    char b;
    cin >> b;
    
    switch(b){
        case 'A':
        cout << 'T' << endl;
        break;
        case 'T':
        cout << 'A' << endl;
        break;
        case 'G':
        cout << 'C' << endl;
        break;
        case 'C':
        cout << 'G' << endl;
        break;
        default: break;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mxn 1000010
#define db double
#define LL long long
#define ldb long double
#define ull unsigned long long
#define pb push_back
#define ppb pop_back
#define pf push_front
#define pul pair<ull,LL> 
#define pii pair<int,int> 
#define mp make_pair
#define fr first
#define sc second
#define x1 faqx1
#define y1 faqy1
#define x2 faqx2
#define y2 faqy2
using namespace std;
const int N=(1<<14)-1,mod=998244353;
const LL inf=1e18;
template<typename T> void chkmin(T &x,T y) {if(y<x) x=y;}
template<typename T> void chkmax(T &x,T y) {if(y>x) x=y;}
template<typename T> void upd(T &x,T y) {if((x+=y)>=mod) x-=mod;}
int n,m,X,Y,A,B,C,sl,fh;
LL ans,s[mxn];
pii p[mxn];
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
bool cmp(const pii &x,const pii &y)
{
	if(x.fr!=y.fr) return x.fr>y.fr;
	return x.sc<y.sc;
}
int main()
{
	ios::sync_with_stdio(false);
	X=rd();Y=rd();A=rd();B=rd();C=rd();
	for(int i=1;i<=A;++i) p[++n]=mp(rd(),1);
	for(int i=1;i<=B;++i) p[++n]=mp(rd(),2);
	for(int i=1;i<=C;++i) p[++n]=mp(rd(),3);
	sort(p+1,p+n+1,cmp);
	for(int i=1;i<=n;++i)
		if(p[i].sc==1)
		{
			if(X) ans+=p[i].fr,--X;
			if(m>=X+Y) return printf("%lld\n",ans+s[X+Y]),0;
		}
		else if(p[i].sc==2)
		{
			if(Y) ans+=p[i].fr,--Y;
			if(m>=X+Y) return printf("%lld\n",ans+s[X+Y]),0;
		}
		else
		{
			++m;s[m]=s[m-1]+p[i].fr;
			if(m>=X+Y) return printf("%lld\n",ans+s[X+Y]),0;
		}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 8448
#include <iostream>
#include <string>

using namespace std;

int main() {
    int N;
    string S;
    int A[300010];
    cin >> N;
    cin >> S;

    if(S[0] == 'E') A[0] = 1;
    else A[0] = 0;

    for(int i = 1; i< N; i++){
        if(S[i] == 'E') A[i] = A[i-1]+1;
        else A[i] = A[i-1];
    }

    int change = 0;
    int min = 99999999;//N;
    for(int i = 0; i < N; i++) {
        if(i == 0) {
            change = A[N-1] - A[0];
        } else if(i >= N-1) {
            change = N-1 - (A[N-2]);
        } else {
            change = i - (A[i-1]) +  (A[N-1] - A[i]);
        }

        if(change <= min) {
            min = change;
        }
    }

    cout << min << endl;
    return 0;
}

Measured memory_bytes: 1796
// ABC 061 B- Counting Roads
// 配列の練習

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

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

  // 二つの都市を結ぶから、道の数×2を配列数にすればよい…はず
  vector<int> vec1(2 * M);
  rep(i, 2 * M) {
    cin >> vec1.at(i);
  }
  // N個の配列を初期値０で作って、一致したら数増やす
  vector<int> vec2(N, 0);
  rep(i, N) {
    rep(j, 2 * M){
      if (i + 1 == vec1.at(j)) {
        vec2.at(i) += 1; // カウント,数はNこ
      }
    }
  }
  // 出力
  rep(i, N) {
    cout << vec2.at(i) << endl;
  }
}

Measured memory_bytes: 3644
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] t = sc.next().toCharArray();
        Arrays.sort(s);
        Arrays.sort(t);
        String ss = new String(s);
        String ts = new String(t);
        ts = new StringBuilder(ts).reverse().toString();
        System.out.println(ss.compareTo(ts) < 0 ? "Yes" : "No");
    }
}


Measured memory_bytes: 23892
// lcmとかはg++ -std=c++17 default.cppみたいなかんじで
#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1001001001
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
//#define double long double
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
using namespace std;

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

    ll a,b,c,n,f=0,mini=INF;
    ll sum=0,maxi=0;
    string str,sub;
    ll h,w;
    ll m,k;
    cin>>n>>k;
    //vector<ll> v(n);
    rep(i,n) cin>>a;
    n-=k;
    sum++;
    if(n>0&&n%(k-1)) sum++;
    cout<<n/(k-1)+sum<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
	int n,m,a,b;
	while(cin>>n>>m,n){
		int d[n],p[n],cnt=0;
		for(int i=n;i>0;i--){
			d[cnt]=i;
			p[cnt]=0;
			cnt++;
		}
		for(int i=0;i<m;i++){
			cin>>a>>b;
			for(int j=0;j<a-1;j++)
			p[j]=d[j];
			for(int j=0;j<b;j++)
			d[j]=d[a-1+j];
			for(int j=0;j<a-1;j++)
			d[b+j]=p[j];
		}
		cout<<d[0]<<endl;
	}
	return 0;
}

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

int main()
{
    string s,t;
    cin >> s >> t;
    int ss=s.size(),tt=t.size();
    int ans = 2000;
    for(int i=0;i<=ss-tt;i++)
    {
        int cnt=0;
        for(int j=0;j<tt;j++)
        {
            if(s[i+j]==t[j])    cnt++;
        }
        ans = min(ans,tt-cnt);
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3572
#include <iostream>
#include <boost/multiprecision/cpp_int.hpp>
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <sstream>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
namespace mp = boost::multiprecision;
using namespace std;
using ull = unsigned long long;
using ld = long double;
//using ll = boost::multiprecision::cpp_int;
using ll = long long;
#define FORi(N) for(ll i = 0; i < N; ++i)
#define FORj(N) for(ll j = 0; j < N; ++j)
#define FORk(N) for(ll k = 0; k < N; ++k)
//using int = ll;
ll gcd(ll m, ll n) {
    if(n == 0)
        return abs(m);
    return (gcd(n, m % n));
}
void putYN(bool b) {
    if(b) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}
void swap(ll &a, ll &b) {
    ll tmp = a;
    a = b;
    b = tmp;
}
ll combi(ll n, ll k) {
    ll r = 1 ,rr =1;
    for(ll i=0;i<k;++i) {
      r*=(n-i);
      rr*=(i+1);
      //r %= 1000000007;
      //rr %= 1000000007;
    }
    r/=rr;
    //r %= 1000000007;
    return r;
}

int main() {
  ll N,M;
  cin>>N>>M;
  vector<vector<ll>> T(N,vector<ll>()); 
  vector<ll> valid(N,1);
  FORi(M){
    ll x,y,z;
    cin>>x>>y>>z;
    T[x-1].push_back(y-1);
    T[y-1].push_back(x-1);
  }
  FORi(N){
    if(valid[i]!=1)continue;
    valid[i]=0;
    function<void(ll)> f =[&](ll now){
      for(auto j:T[now]){
        if(valid[j]!=1)continue;
        valid[j]=0;
        f(j);
      }
    }; 
    f(i);
    valid[i]=1;
  }
  ll num=0;
  FORi(N){
    num+=valid[i];
  }
  cout<<num<<endl;
  return 0;
}


Measured memory_bytes: 11136
mod = 1000000007
n = gets.to_i
a = gets.split.map(&:to_i)
len = a.max.to_s(2).length

ans = 0
len.times do |l|
  n_1 = a.count { |x| x[l] == 1 }
  v = l >= 30 ? (2 ** l) % mod : (2 ** l)
  ans += ((n - n_1) * n_1 * v ) % mod
  ans %= mod
end
puts ans


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

int main(){
  int n,ans; cin >>n >>ans;
  rep(i,n-1) {
    int a; cin >>a;
    ans = gcd(a,ans);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3596
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
mod util {
    use std::fmt::Debug;
    use std::io::{stdin, stdout, BufWriter, StdoutLock};
    use std::str::FromStr;
    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }
    #[allow(dead_code)]
    pub fn chars() -> Vec<char> {
        line().chars().collect()
    }
    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
    #[allow(dead_code)]
    pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
        let out = stdout();
        let writer = BufWriter::new(out.lock());
        f(writer)
    }
}
#[allow(unused_macros)]
macro_rules ! get { ( [ $ t : ty ] ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . split_whitespace ( ) . map ( | t | t . parse ::<$ t > ( ) . unwrap ( ) ) . collect ::< Vec < _ >> ( ) } } ; ( [ $ t : ty ] ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( [ $ t ] ) ) . collect ::< Vec < _ >> ( ) } ; ( $ t : ty ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,* ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; let mut iter = line . split_whitespace ( ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; ( $ t : ty ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ ( $ t : ty ) ,*; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ ( $ t ) ,* ) ) . collect ::< Vec < _ >> ( ) } ; }
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } }
const BIG_STACK_SIZE: bool = true;
#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}
fn solve() {
    let (x, y) = get!(usize, usize);
    println!("{}", x + y / 2);
}


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

#define cc(x) cout << (x) << endl
#define rep(i,n) for(int i = 0; i < int(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef vector<long long> vll;

template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

const ll inf = 1LL<<58;
const int iinf = 1<<30;

int main(){
    int n;
    cin >> n;
    string s[n];
    rep(i,n){
        cin >> s[i];
    }
    int count=0;
    int a=0;
    int b=0;
    int ba=0;
    rep(i,n){
        rep(j,s[i].size()-1){
            if(s[i][j]=='A' && s[i][j+1]=='B'){
                count++;
            }
        }
        if(s[i][0]=='B'){
            b++;
        }
        if(s[i][s[i].size()-1]=='A'){
            a++;
        }
        if(s[i][s[i].size()-1]=='A' && s[i][0]=='B'){
            ba++;
        }
    }
    // cc(count);
    // cc(a);
    // cc(b);
    if(a==ba && b==ba && ba!=0){
        count+=a-1;
    }else{
        amin(a,b);
        count+=a;
    }
    cc(count);
}

Measured memory_bytes: 768
#include <stdio.h>

int main() {
  int a,b;
  scanf("%d%d",&a,&b);
  float c=((float)a+(float)b)/3;
  float A=(float)a/3;
  float B=(float)b/3;
  
  if(c-(int)c== 0){
    printf("Possible");
  }
  else if(A-(int)A== 0){
    printf("Possible");
  }
  else if(B-(int)B== 0){
    printf("Possible");
  }
  else{
    printf("Impossible");
  }
  return 0;
}

Measured memory_bytes: 128
n = int(input())
s1 = input()
s2 = input()
if s1[0] == s2[0]:
    a = 3
    l = 0
    v = True
else:
    a = 6
    l = 1
    v = False
mod = 10**9+7
def mult_mod(x,y):
    return (x*y) % mod
while l+1 < n:
    if v:
        if s1[l+1] == s2[l+1]:
            l += 1
            a = mult_mod(a,2)
        else:
            l += 2
            a = mult_mod(a,2)
            v = False
    else:
        if s1[l+1] == s2[l+1]:
            l += 1
            v = True
        else:
            l += 2
            a = mult_mod(a,3)

print(a%mod)

Measured memory_bytes: 9152
from math import gcd

from math import factorial as f

from math import ceil, floor, sqrt
import math

import bisect
import re
import heapq

from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

yes = "Yes"
no = "No"


def main():
    x = ii()
    print(10 - (x // 200))


main()


Measured memory_bytes: 10008
import math
from sys import stdin

N = int(input())
MOD = 1000000007

def solve(N):
    res=1
    zn=1
    zz=1
    zo=1
    for i in range(N):
        res=(res*10)%MOD
    for i in range(N):
        zn=(zn*9)%MOD
    for i in range(N):
        zz=(zz*9)%MOD
    for i in range(N):
        zo=(zo*8)%MOD
    zx = ((zz + zn)%MOD - zo) % MOD
    return (res-zx)%MOD

if(N<2):print(0)
else: print(solve(N))

Measured memory_bytes: 9212
N=int(input())
A=[int(n) for n in input().split()]
B=[int(n) for n in input().split()]
C=[int(n) for n in input().split()]
ans = 0
pre = -1
for i in A:
    ans += B[i-1]
    if pre == i-1:
        ans += C[i-2]
    pre = i
print(ans)

Measured memory_bytes: 3064
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;


void solve(long long A, long long B, long long C){
    if(A&1 || B&1 || C&1){
        cout << 0 << endl;
        return;
    }
    if(A==B && B==C){
        cout << -1 << endl;
        return;
    }
    ll cnt = 0, Atmp, Btmp, Ctmp;
    while(!(A&1 || B&1 || C&1)){
        cnt ++;
        Atmp = (B+C)/2;
        Btmp = (A+C)/2;
        Ctmp = (A+B)/2;
        A = Atmp;
        B = Btmp;
        C = Ctmp;
    }
    cout << cnt << endl;
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    solve(A, B, C);
    return 0;
}


Measured memory_bytes: 256
#include <map>
#include <iostream>
#include <string>
#include <set>
#include <vector>
#include <bits/stdc++.h>
#include <complex>
#include <numeric>
#include <climits>
#include <stack>
#include <clocale>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <ctime>
#include <deque>
#include <queue>
#define mp make_pair
#define pii pair<int,int>
#define ll long long
#define rept(i,n)for(int i=0;i<(int)(n);i++)
#define fi first
#define se second
using namespace std;
string p;
int s[100100],p1[100100],n;
int main(){
	cin>>n;
	cin>>p;
	int i,j;
	for(i=0;p[i];i++)
	{
		if(p[i]=='o')p1[i+1]=0;
		else p1[i+1]=1;
	}
	p1[n+1]=p1[1];
	for(i=0;i<8;i++)
	{
		s[0]=i&1;
		s[1]=(i>>1)&1;
		s[2]=(i>>2)&1;
		for(j=2;j<=n+1;j++)
		{
			s[j+1]=s[j-2]^p1[j];
		}
		if(s[0]^s[n]^s[1]^s[n+1] || s[1]^s[n+1]^s[2]^s[n+2])continue;
		for(j=1;j<=n;j++){
			printf("%c",(s[j]^s[j-1])?'W':'S');
		}
		return 0;
	}
	printf("-1\n");
	return 0;
}


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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
/*////////////////////////////////////////////////////*/


int main(){

	int n;
	cin >> n;

	double ans=0;
	double money;
	string currency;

	rep(i,n){
		cin >> money >> currency;
		if( currency == "BTC" ){ ans += money * 380000.0; }
		else{ ans += money; }
	}

	cout << ans;

}

Measured memory_bytes: 256
//Use valgrind once if the submission doesn't go through. It can detect uninitialized variables and see where they could be an issue.
#include <bits/stdc++.h>
using namespace std;

int main(){

	ios_base::sync_with_stdio(false);
    	cin.tie(NULL);

	string s;
	int K;
	cin>>K>>s;
	if(K<s.size())
	{
		cout<<s.substr(0,K)<<"..."<<endl;
	}
	else
	{
		cout<<s<<endl;
	}
	return 0;
}


Measured memory_bytes: 3656
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;



int main(){

	int n, h[100], ans=0, tmp=0;
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> h[i];
	}
	for(int i=1; i<n; i++){
		if(h[i-1]>h[i]){
			ans+=h[i-1];
			ans-=h[i];
		}
	}
	cout << ans+h[n-1] << endl;

	return 0;
}


Measured memory_bytes: 256
num = int(input())
input_data = input().split(' ')
if("1" in input_data):
    input_data = input_data[input_data.index('1'):]
    ref = 1
    for i in range(len(input_data)):
        if(int(input_data[i]) - ref == 1):
            ref += 1

    print(num - ref)
else:
    print('-1')


Measured memory_bytes: 18332
# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
S = input()

N = len(S)
ans = [-1,-1]

for i in range(N-1):
    if S[i]==S[i+1]:
        ans = [i+1,i+2]
        break

for i in range(N-2):
    if S[i]==S[i+2]:
        ans = [i+1, i+3]
        break

print(ans[0], ans[1])

Measured memory_bytes: 3188
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
 
int main (){
int a,s,d;
 
cin >>a >>s >>d;
  d-=a;
  d+=s;
  if(d>0){
cout <<d <<endl;}
  else{
  cout << 0 <<endl;}
return 0;
 
}

Measured memory_bytes: 256
class T:
    def __init__(self):
        self.min_count = 0
        self.words = {}

while True:
    data = {chr(c): T() for c in range(ord('a'), ord('z') + 1)}
    n = int(input())
    if not n:
        break
    for i in range(n):
        for s in input().split():
            d = data[s[0]]
            if s in d.words:
                d.words[s] -= 1
            else:
                d.words[s] = -1
            if d.words[s] < d.min_count:
                d.min_count = d.words[s]
    
    res = ' '.join(map(lambda v: v[1], sorted(list(map(lambda a: a[::-1], data[input()].words.items())), reverse=True)[:-6:-1]))
    print(res if res else 'NA')
    

Measured memory_bytes: 6732
using System;

class Program
{
    static void Main(string[] args)
    {
        var abc = Console.ReadLine().Split();
        var a = int.Parse(abc[0]);
        var b = int.Parse(abc[1]);
        var c = int.Parse(abc[2]);

        if (b - a == c - b)
        {
            Console.WriteLine("YES");
        }
        else
        {
            Console.WriteLine("NO");
        }
    }
}


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

struct da
{
    int day;
    int re;
};

bool cmp(const da &a, const da &b)
{
    return a.day < b.day;
}

int main()
{
    int a, b;//b_day
    std::cin>> a >> b;

    std::vector< da > data;

    for( int i = 0 ; i < a; i++ )
    {
        da d;
        std::cin>> d.day >> d.re;
        data.push_back( d );
    }

    std::sort( data.begin(), data.end(), cmp );

    int all_reward = 0;
    int num = 0;
    std::priority_queue<int> Q;

    for( int i = 1; i <= b; i++ )
    {
        for( int r = num; r < data.size(); r++ )
        {
            if( i == data[r].day )
            {
                Q.push( data[r].re );
            }
            else
            {
                num = r;
                break;
            }
        }

        if( !Q.empty() )
        {
            all_reward += Q.top();
            Q.pop();
        }
    }

    std::cout<< all_reward;
}


Measured memory_bytes: 1908
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int N;
vector<double> v;
double memo[3009][3009];
bool vis[3009][3009];
ll mod=1e9+7;
double sol(int pos,int k){
  if(pos==N)return k>(N/2);
  if(vis[pos][k])return memo[pos][k];
  vis[pos][k]=1;
  return memo[pos][k]=sol(pos+1,k+1)*v[pos]+sol(pos+1,k)*(1-v[pos]);
}
int main(){
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
		//freopen("input.txt","r",stdin);
		//freopen("output.txt","w",stdout);
		cin>>N;
		for(int i=0;i<N;i++){
      double a;
      cin>>a;
      v.push_back(a);
		}
		cout<<fixed<<setprecision(20)<<sol(0,0);
    return 0;
}

Measured memory_bytes: 80000
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;

#define rep(i,a) for(int i=0; i<a; i++)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define loop3(i,j,k,a) for(int i=0; i<a; i++)for(int j=0; j<a; j++)if(i!=j)for(int k=0; k<a; k++)if(i!=k&&j!=k)
#define loop4(i,j,k,l,a) for(int i=0; i<a; i++)for(int j=0; j<a; j++)if(i!=j)for(int k=0; k<a; k++)if(i!=k&&j!=k)for(int l=0; l<a; l++)if(i!=l&&j!=l&&k!=l)
#define rep1(i,a) for(int i=1; i<=a; i++)

#define scnd1(a) scanf("%d", &a)
#define scnd2(a,b) scanf("%d%d", &a,&b)
#define scnd3(a,b,c) scanf("%d%d%d", &a,&b,&c)
#define scnd4(a,b,c,d) scanf("%d%d%d%d", &a,&b,&c,&d)

#define cin1(a) cin >> a;
#define cin2(a,b) cin >> a >> b;
#define cin3(a,b,c) cin >> a >> b >> c;
#define cin4(a,b,c,d) cin >> a >> b >> c >> d;
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define prtd1(a) printf("%d\n", a)
#define prtd2(a,b) printf("%d %d\n", a,b)
#define prtd3(a,b,c) printf("%d %d %d\n", a,b,c)
#define prtd4(a,b,c,d) printf("%d %d %d %d\n", a,b,c,d)

#define mem(a,n) memset( a, n, sizeof(a))
#define INF 1000000000
typedef long long ll;

ll nums[55];

int main() {
    int N;
    cin >> N;
    
    rep(i,N) cin >> nums[i];
    
    pair<ll,int> maxv={nums[0],0}, minv={nums[0],0};
    rep(i,N) {
        if (maxv.first<nums[i]) maxv={nums[i],i};
        if (minv.first>nums[i]) minv={nums[i],i};
    }
    
    vector<pair<int,int>> ans;
    
    if ( abs(maxv.first) > abs(minv.first) ) {
        rep(i,N) if (nums[i]<0) ans.push_back( {maxv.second+1, i+1} );
        cout1(N-1+ans.size());
        rep(i,ans.size()) {
            cout2(ans[i].first,ans[i].second);
        }
        rep1(i,N-1) {
            cout2(i,i+1);
        }
    } else {
        rep(i,N) if (nums[i]>0) ans.push_back( {minv.second+1, i+1} );
        cout1(N-1+ans.size());
        rep(i,ans.size()) {
            cout2(ans[i].first,ans[i].second);
        }
        rrep(i,N-2) {
            cout2(i+2,i+1);
        }
    }
}

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

int main() {
	int n;
	cin>>n;
	int arr[n];
	for(int i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	arr[0]--;
	for(int i=1;i<n;i++)
	{
		if(arr[i]>arr[i-1])
		{
			arr[i]--;
		}
		if(arr[i]<arr[i-1])
		{
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes";
	return 0;
}

Measured memory_bytes: 640
/* 
chirag11032000
Chirag Thakur
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;

template < typename T > using OrderedSet = tree < T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update >;
template < typename T > using MinPriorityQueue = priority_queue < T, vector < T >, greater < T > >;

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1) {
	cerr << name << " : " << arg1 << std::endl;
}
template < typename Arg1, typename... Args >
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | ";
	__f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))

const db PI = acos(-1);
const ll LINF = LLONG_MAX;
const int INF = INT_MAX, MOD = 1e9 + 7, N = 1e5 + 10;

void test_case();

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	test_case();
	cerr << "Time taken: " << int((clock() * 1000.) / CLOCKS_PER_SEC) << "ms\n";
	return 0;
}

void test_case() {
	int n, m;
	cin >> n >> m;
	int check = n;
	vector < int > cnt(m + 1);
	while (n--) {
		int k;
		cin >> k;
		while (k--) {
			int pos;
			cin >> pos;
			++cnt[pos];
		}
	}
	int ans = 0;
	for (int i = 1; i <= m; ++i) {
		ans += cnt[i] == check;
	}
	cout << ans << "\n";
}

Measured memory_bytes: 256
import math
H = int(input())
count = 0
enemy = 1
enemyH = H
while enemy > 0:
  if enemyH == 1:
    count += enemy
    enemy =0
  else :
    X = (enemyH/2)
    x = math.floor(X)
    enemyH =x
    count += enemy
    enemy =enemy*2
print(count)


Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const int N=1e5+10;
int xx[N],yy[N];
int d[N],n,m,x,y,cnt,a;
int fa[N];
int find_f(int x){return x==fa[x]?x:find_f(fa[x]);
}
int main(){
//	freopen("a.in","r",stdin);
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++){
		scanf("%d%d",&xx[i],&yy[i]);d[xx[i]]++;d[yy[i]]++;
	}
	for(int i=1;i<=n;i++)if(d[i]&1){puts("No");return 0;}
	for(int i=1;i<=n;i++) if(d[i]>=6){puts("Yes");return 0;}
	for(int i=1;i<=n;i++)if(d[i]==4){cnt++;a=i;}
	if(cnt>=3) {puts("Yes");return 0;}
	if(cnt<2){puts("No");return 0;}
	cnt=0;for(int i=1;i<=n;i++)fa[i]=i;
	for(int i=1;i<=m;i++){
		x=xx[i];y=yy[i];if(x==a||y==a)continue;x=find_f(x);y=find_f(y);
		if(x!=y)fa[x]=y;
	}
	for(int i=1;i<=n;i++)cnt+=find_f(i)==i;
	if(cnt==3)puts("Yes");else puts("No");
}

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

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

using namespace std;

int main(){
  string w;
  cin>>w;
  map<char, int> m;
  rep(i, w.size()){
    m[(char)w.at(i)]++;
  }
  for(auto p:m){
    if(p.second%2!=0){
      cout<<"No";
      return 0;
    }
  }

  cout<<"Yes";

  return 0;
}


Measured memory_bytes: 768
import sys
sys.setrecursionlimit(10**6)

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))

    ans = [0] * N
    sign = -1
    for a in A:
        sign *= -1
        ans[0] += sign * a

    for i in range(1, N):
        ans[i] = A[i-1] * 2 - ans[i-1]

    print(' '.join(map(str, ans)))


if __name__ == '__main__':
    main()


Measured memory_bytes: 19124
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl "\n"
using namespace std;

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

    string s;
    cin >> s;
    if ((s[2]==s[3])&&(s[4]==s[5]))
    {
        cout << "Yes" << endl;
    }    
    else
    {
        cout << "No" << endl;
    }

    return 0;    
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  cin>>N;
  string S;
  cin>>S;
  if(N%2!=0) {
    cout<<"No"<<endl;
    return 0;
  }
  string tmp = S.substr(0, N/2);
  int index = 0;
  bool ok = true;
  for(int i=N/2;i<N;++i) {
    if(tmp[index]!=S[i]) ok = false;
    index++;
  }
  if(ok)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}



Measured memory_bytes: 3528
import sys

x,n = map(int, input().split())
p = sorted(list(map(int, input().split())))
res = [x,-1]
for i in range(101):
    a = x - i
    b = x + i
    if a not in p:
        print(a)
        sys.exit()
    if b not in p:
        print(b)
        sys.exit()

Measured memory_bytes: 9196
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
using namespace std;

int n, m;
vector<pair<int, int>>u, v;
map<pair<int, int>, int>mp;

int main(){
    cin >> n >> m;
    for (int i = 0; i < m; i++){
        int p, y;
        cin >> p >> y;
        pair<int, int> a = make_pair(p, y);
        u.push_back(a);
        v.push_back(a);
    }
    sort(u.begin(), u.end());
    int f = 0, s = 0;
    for (int i = 0; i < m; i++){
        pair<int, int> a = u[i];
        if (f != a.first)f = a.first, s = 0;
        s++;
        mp[a] = s;
    }
    for (int i = 0; i < m; i++){
        pair<int, int> a = v[i];
        printf("%06d%06d\n", a.first, mp[a]);
    }
}

Measured memory_bytes: 9324
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
for i in range(len(a)):
    ans += b[a[i]-1]
    if a[i]-a[i-1] == 1 and i > 0:
        ans += c[a[i-1]-1]
print(ans)

Measured memory_bytes: 38384
// #include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
// #include <algorithm>
#define pb push_back
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
// #define cerr if(0)cerr
using namespace std;
typedef long long LL;

const int N=100010;
int n;
LL T[N],DP[N];

LL abso(LL x){
  if(x<0) return -x;
  return x;
}

LL mino(LL x, LL y){
  if(y<x)return y;
  return x;
}

int main()
{
  // boost;
  scanf("%d",&n);
  for(int i=1; i<=n; i++)
  {
    scanf("%lld",&T[i]);
  }
  DP[2]=abso(T[2]-T[1]);
  for(int i=3; i<=n; i++)
  {
    DP[i]=mino(abso(T[i]-T[i-1])+DP[i-1],abso(T[i]-T[i-2])+DP[i-2]);
  }
  printf("%lld",DP[n]);

  return 0;
}


Measured memory_bytes: 1664
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author houghstc
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <vector>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
#include <cstring>

using namespace std;
using pii = pair<int, int>;
using ll = long long;
using pll = pair<ll, ll>;

const int MOD = 1e9+7;

class BMultipleOf9 {
public:
    void solve(std::istream& in, std::ostream& out) {
        char c;
        int remain = 0;
        while(in >> c)
        {
            remain += c - '0';
            remain %= 9;
        }
        out << ((remain == 0) ? "Yes" : "No") << endl;
    }
};


int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    BMultipleOf9 solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3692
#include<bits/stdc++.h>
    #include<algorithm>
    using namespace std;
    #define mod 1e9+7
    #define FOR(a,c)   for ( long long int (a)=0; (a)<(c); (a)++)
    #define FORL(a,b,c)  for ( long long int (a)=(b); (a)<=(c); (a)++)
    #define FORR(a,b,c)  for (  long long int (a)=(b); (a)>=(c); (a)--)
    #define INF 1000000000000000003
    typedef long long int ll;
    typedef vector<long long int> vi;
    typedef pair<long long int,long long int> pi;
    typedef priority_queue<long long int> max_pq;
    typedef priority_queue<long long int, vector<long long int>, greater<long long int>> min_pq;
    #define F first
    #define S second
    #define PB push_back
    #define POB pop_back
    #define MP make_pair
    #define pi 3.1415926535
    #define buff cin.ignore(numeric_limits<streamsize>::max(),'\n')

    // Use inbuilt function  __gcd(a,b), __builtin_popcount(n), Use (x&-x) for last set Bit;
    
    ll knapSackRec(ll W, ll wt[], ll val[], ll i, ll **dp) 
{ 

    // base condition 
    if (i < 0) 
        return 0; 
    if (dp[i][W] != -1) 
        return dp[i][W]; 
  
    if (wt[i] > W) { 
  
        // Store the value of function call  
        // stack in table before return 
        dp[i][W] = knapSackRec( W, wt, val, i - 1, dp); 
        return dp[i][W]; 
    } 
    else { 
  
        // Store value in a table before return 
        dp[i][W] = max( val[i] + knapSackRec( W - wt[i], wt, val, i - 1, dp), knapSackRec(W, wt, val, i - 1, dp)); 
  
        // Return value of table after storing 
        return dp[i][W]; 
    } 
} 

ll knapSack(ll W, ll wt[], ll val[], ll n) 
{ 
    // double pointer to declare the  
// table dynamically 
    ll** dp; 
    dp = new ll*[n]; 
  
    // loop to create the table dynamically 
    for (ll i = 0; i < n; i++) 
        dp[i] = new ll[W + 1]; 
  
    // loop to initially filled the  
// table with -1 
    for (ll i = 0; i < n; i++) 
        for (ll j = 0; j < W + 1; j++) 
            dp[i][j] = -1; 
    return knapSackRec(W, wt, val, n - 1, dp); 
} 
    int main()
    {
        ios::sync_with_stdio(NULL);
        cin.tie(NULL);
        cout.tie(NULL);

        ll n,w;
        cin>>n>>w;
        ll val[n],wt[n];
        for(ll i=0;i<n;i++)
            cin>>wt[i]>>val[i];
        ll res = knapSack(w,wt,val,n);
        cout<<res<<endl;

        return 0;
    }

Measured memory_bytes: 78720
import numpy as np
import copy as cp

def isTree(now=0):
    know[now] = 1
    for next in range(n):
        if know[next]==1 or graph[now][next]==0: continue
        else: isTree(next)
    if all(know): return 1
    else: return 0

# nは頂点の数
n, m = map(int,input().split())
ab = np.array([list(map(int,input().split())) for i in range(m)])
a,b = ab.T[0]-1,ab.T[1]-1

#隣接行列
G = [[0] * n for _ in range(n)]
for aa,bb in zip(a,b): G[aa][bb],G[bb][aa] = 1,1

ans = 0
for x,y in zip(a,b):
    graph = cp.deepcopy(G)
    graph[x][y],graph[y][x] = 0,0
    know = [0]*(n)
    if not isTree(): ans += 1

print(ans)



Measured memory_bytes: 12500
#include <iostream>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <functional>
#include <random>
#include <bits/stdc++.h>

#include <stdio.h>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <math.h>
#include <ctime>
#include <cstring>

typedef long long ll;
using namespace std;

//入力
int x,y ;

int main() {

	cin >> x >> y;

	cout << x+y/2 << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	string s;
	cin >> s;
	int a = 0, b = 0, c= 0;
	for(int i = 0; i < 3; i++)
		if(s[i] == 'a') a++;
		else if(s[i] == 'b') b++;
		else if(s[i] == 'c') c++;
	if(a == 1 && b == 1 && c == 1)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}

Measured memory_bytes: 256
package main

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

// AtCoder Functions
var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func max(nums []int) int {
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		if res < nums[i] {
			res = nums[i]
		}
	}
	return res
}

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()
	H := make([]int, N)
	for i := 0; i < N; i++ {
		H[i] = nextInt()
	}

	ret := 0
	NUMS := make([]int, 0)
	for i := 0; i < N-1; i++ {
		if H[i] >= H[i+1] {
			ret++
			continue
		} else {
			NUMS = append(NUMS, ret)
			ret = 0
		}
	}
	NUMS = append(NUMS, ret)
	fmt.Println(max(NUMS))
}


Measured memory_bytes: 5760
A = list(map(int,input().split(" ")))
B = list(map(int,input().split(" ")))
C = list(map(int,input().split(" ")))
max_x = max(B)
min_y = min(C)
X = A[2]
count = -100
Y = A[3]
for i in range(200):
    if X < count <= Y and max_x < count and count <= min_y:
        print("No War")
        exit()
    count += 1
print("War")

Measured memory_bytes: 3064
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"

#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define all(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define LINF ((ll)1 << 60)
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;

struct UnionFind {
        vector<int> data;
        UnionFind(int size) : data(size, -1) { }
        bool unite(int x, int y) {
                x = root(x); y = root(y);
                if (x != y) {
                        if (data[y] < data[x]) swap(x, y);
                        data[x] += data[y]; data[y] = x;
                }
                return x != y;
        }
        bool same(int x, int y) {
                return root(x) == root(y);
        }
        int root(int x) {
                return data[x] < 0 ? x : data[x] = root(data[x]);
        }
        int size(int x) {
                return -data[root(x)];
        }
};

int T = 1;
int N, K, L;
UnionFind uf1(MAX);
UnionFind uf2(MAX);

void solve() {
        cin >> N >> K >> L;
        rep(i, K) {
                int x, y;
                cin >> x >> y;
                uf1.unite(x, y);
        }
        rep(i, L) {
                int x, y;
                cin >> x >> y;
                uf2.unite(x, y);
        }
        map<pair<int,int>,int> m;
        REP(i, 1, N+1) {
                m[{uf1.root(i), uf2.root(i)}]++;
        }
        REP(i, 1, N) {
                cout << m[{uf1.root(i), uf2.root(i)}] << " ";
        }
        cout << m[{uf1.root(N), uf2.root(N)}] << endl;
}

signed main() {
        cout << fixed << setprecision(20);
        rep(i, T) {
                solve();
        }
        return 0;
}

Measured memory_bytes: 13696
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <map>
#include <set>
#include <ctype.h>
#include <numeric>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9 + 7;
const int INF = 1e9;

int dx4[4] = { 0, -1, 1, 0 };
int dy4[4] = { -1, 0, 0, 1 };
int dx8[8] = { 0, -1, 1, 0, -1, 1, -1, 1 };
int dy8[8] = { -1, 0, 0, 1, -1, -1, 1, 1 };

int main() {
  int a, b; cin >> a >> b;
  int ans = a + b;
  if (ans > 23) ans -= 24;
  cout << ans << endl;
  return 0;
}


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

using namespace std;

bool isExistsPattern(string s, string ptn){
  int count = 0;
  int idx = 0;
  for(int a=0; a<s.size(); a++){
    if( ptn[idx] == s.at(a)){
      count += 1;
      idx++;
    }
    if( count >= 3 ) return true;
  }
  return false;
}

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

  int ans = 0;
  for(int i=0; i<10; i++){
    for(int j=0; j<10; j++){
      for(int k=0; k<10; k++){
        string pattern = to_string(i) + to_string(j) + to_string(k);
        ans += isExistsPattern( s, pattern );
      }
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 384
//by (111110101)2
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
const long long md=1e9+7;
struct st
{
	long long mp[55][55];
};
st a;
long long n,k,tt;
st ch(st a,st b)
{
	st rt;
	memset(rt.mp,0,sizeof(rt.mp));
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			for(int k=1;k<=n;k++)
			{
				rt.mp[i][j]+=a.mp[i][k]*b.mp[k][j]%md;
				rt.mp[i][j]%=md;
			}
		}
	}
	return rt;
}
st js()
{
	st ans;
	memset(ans.mp,0,sizeof(ans.mp));
	for(int i=1;i<=n;i++)
	{
		ans.mp[i][i]=1;
	}
	while(k)
	{
		if(k&1)
		{
			ans=ch(ans,a);
		}
		a=ch(a,a);
		k>>=1;
	}
	return ans;
}
int main()
{
	cin>>n>>k;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			cin>>a.mp[i][j];
		}
	}
	st ans=js();
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			tt+=ans.mp[i][j];
			tt%=md;
		}
	}
	cout<<tt<<endl;
	return 0;
}

Measured memory_bytes: 384
main = do
  n <- readLn :: IO Int
  ps <- map read . words <$> getLine :: IO [Int]
  putStrLn $ show $ count ps

foldlState :: (a -> c -> b -> (a, c)) -> a -> c -> [b] -> a
foldlState f a s l = fst $ foldl (\(a, s) -> f a s) (a, s) l

count :: [Int] -> Int
count ps = foldlState step 0 (head ps) ps
    where step a m x = if m < x then (a, m) else (a + 1, x)


Measured memory_bytes: 35196
#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>
#include <bitset>

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 long long LL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<string, int> P;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define 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(int i=0; i<(n); i++)

//constant
//--------------------------------------------
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;
const LL MOD = 1e9+7; 
//vector <vector<int>> x(20, vector<int> (20)), y(20,vector<int> (20));
/*int counter_1 (int x) {
    if(x == 0) return 0;
    return counter_1(x >> 1) + (x & 1);
}*/

//int Counter(int x)
/*int factorial(int n) {
    if (n > 0) {
        return n * factorial(n - 1);
    } else {
        return 1;
    }
}*/
int factorial(int n) {
    if (n > 0) {
        return n * factorial(n - 1);
    } else {
        return 1;
    }
}
LL sum(LL a, LL b){
    LL cnt=0;
    cnt=(b-a+1)*(a+b)/2;
    return cnt;
}
int main(){
    string arc="ARC", abc="ABC", s;
    cin >> s;
    if(s==abc) cout << arc << endl;
    else cout << abc << endl;
}
    




Measured memory_bytes: 3600
import java.lang.Math;
import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        double interest = 100;
        int year = 0;
        while (interest < n){  
            year += 1;
            interest *= 1.01;
            interest = Math.floor(interest);
            if (interest >= n){
                break;
            }
        }
        System.out.println(year);
    }
}


Measured memory_bytes: 35792