akhauriyash/Code-Regression huggingface dataset:
using AtCoderBeginnerContest124.Questions;
using AtCoderBeginnerContest124.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace AtCoderBeginnerContest124.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var s = inputStream.ReadLine().Select(i => i - '0').ToArray();

            var beginZero = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] != i % 2)
                {
                    beginZero++;
                }
            }

            var beginOne = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] != (i + 1) % 2)
                {
                    beginOne++;
                }
            }

            yield return Math.Min(beginZero, beginOne);
        }
    }
}


namespace AtCoderBeginnerContest124
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace AtCoderBeginnerContest124.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace AtCoderBeginnerContest124.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

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

int main(){
    int n, m; scanf("%d%d",&n,&m);
    if(n>m) swap(n,m);

    if(n>=3) return !printf("%lld\n", 1LL*(n-2)*(m-2));
    if(n==2) return !printf("0\n");
    if(n==1) return !printf("%lld\n", m==1?1:m-2);
}


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

int main(){
  int num;
  cin>>num;
  int n[num-1];
  for(int i=0;i<num-1;i++)
    cin>>n[i];
  int answer;
  cin>>answer;
  long long a[num-1][21];
  for(int i=0;i<num-1;i++){
    for(int j=0;j<21;j++){
      a[i][j]=0;
    }
  }

  a[0][n[0]]=1;
  for(int j=1;j<num-1;j++){
    for(int i=0;i<21;i++){
      //if(a[j-1][i]>0){
	if(i+n[j]<21)
	  a[j][i+n[j]]+=a[j-1][i];
	if(i-n[j]>=0)
	  a[j][i-n[j]]+=a[j-1][i];
	//}
    }
  }
  cout<<a[num-2][answer]<<endl;

  return 0;
}

Measured memory_bytes: 1172
use std::io::{BufRead, Write};
use std::io;

fn solve<R: BufRead, W: Write>(mut input: R, mut output: W) {
    let mut buf = String::new();
    input.read_line(&mut buf).unwrap();
    let (_, a, b): (usize, usize, usize) = {
        let mut split = buf.split_whitespace();
        (split.next().unwrap().parse().unwrap(), split.next().unwrap().parse().unwrap(), split.next().unwrap().parse().unwrap())
    };
    writeln!(output, "{}", if a % 2 == b % 2 { "Alice" } else { "Borys" }).unwrap();
}

fn main() {
    let stdin = io::stdin();
    let stdout = io::stdout();
    solve(stdin.lock(), stdout.lock());
}

#[cfg(test)]
mod tests {
    fn test(input: &str, output: &str) {
        let mut v: Vec<u8> = Vec::new();
        ::solve(input.as_bytes(), &mut v);
        assert_eq!(String::from_utf8(v).unwrap(), output);
    }

    #[test]
    fn case1() {
        test(
            "5 2 4\n",
            "Alice\n",
        );
    }

    #[test]
    fn case2() {
        test(
            "2 1 2\n",
            "Borys\n",
        );
    }

    #[test]
    fn case3() {
        test(
            "58 23 42\n",
            "Borys\n",
        );
    }
}

Measured memory_bytes: 4352
#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int n, k;
    cin >> n >> k;
    //cout << n << " " << k << endl;

    // init
    int hasSweets[n];
    for(int i = 0; i < n; i++) {
        hasSweets[i] = 0;
    }

    for(int i = 0; i < k; i++) {
        int d;
        cin >> d;
        for(int j = 0; j < d; j++) {
            int tmp;
            cin >> tmp;
            hasSweets[tmp - 1] = hasSweets[tmp - 1] + 1;
        }
    }

    int sum = 0;
    for(int i = 0; i < n; i++) {
//        cout << hasSweets[i];
        if(hasSweets[i] == 0) {
            sum++;
        }
    }
//    cout << endl;

    cout << sum << endl;

    return 0;
}



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

const int INF = 1<<30;

int main() {
    int N, Q;
    string S;
    cin >> N >> S >> Q;
    vector<set<int>> al(26,set<int>({INF}));
    rep(i,S.size()){
        int index = S[i] - 'a';
        al[index].insert(i);
    }
    rep(_,Q){
        int q;
        cin >> q;
        if(q == 1){
            int i;
            char q;
            cin >> i >> q;
            i--;
            al[S[i]-'a'].erase(i);
            al[q-'a'].insert(i);
            S[i] = q;
        } else {
            int l, r; cin >> l >> r; --l;
            int res = 0;
            for (int c = 0; c < 26; ++c) {
                if (al[c].empty()) continue;
                int lid = *al[c].lower_bound(l);
                int rid = *al[c].lower_bound(r);
                if (rid > lid) ++res;
            }
            cout << res << endl;
        }
    }
}

Measured memory_bytes: 24196
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define per1(i,n) for(int i=n;i>0;i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,ans=0;
    cin>>n;
    rep1(i,n){
        if(i%2==0) continue;
        int a=0;
        rep1(j,i){
            if(i%j==0) a++;
        }
        if(a==8) ans++;
    }
    cout<<ans;
}

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

using namespace std;
#define int long long
signed  main(){
	int a[5];
	for(int i=0;i<3;i++)
		cin>>a[i];
	sort(a,a+3);
	int ans=(a[0]*a[1])/2;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.Random;


public class Main {
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	/*
	 * 
	 *  floor(Ax/B)-A*floor(x/B)
	 * 
	 *   m <=x/B<m+1
	 *=> Am<=Ax/B<(m+1)A
	 *
	 *  このとき A*floor(x/B)=mA 
	 *  
	 * f=floor(Ax/B)-A*floor(x/B)
	 *  =floor(Ax/B)-mA
	 * 
	 * 0<=f<A
	 */
	
	void run() {
		FastScanner sc=new FastScanner();
		long A=sc.nextLong();//1<=A<=1e6
		long B=sc.nextLong();//1<=B<=1e12
		long N=sc.nextLong();//0<=x<=N<=1e12
		
		
		// 0<=x<=B のみを考えればよい
		long x=Math.min(N,B-1);
		System.out.println(A*x/B-A*(x/B));
		
	}
	
	void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}




class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
    	return (int)nextLong();
    }
}

Measured memory_bytes: 32408
use std::io::*;
use std::str::*;

fn main() {
    let mut n: i32 = read_one();
    let mut sig = 1;
    let mut a = 0;
    while n != 0 {
        a += (n % 2).abs() * sig;
        sig *= 2;
        n = (n + if n < 0 {-1} else {0}) / -2;
    }
    println!("{:b}", a);
}

fn read_one<T: std::str::FromStr>() -> T {
    let mut s = stdin().bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.trim().parse().ok().unwrap()
}

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

const int MOD = 1000000007;


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


int main(){
	ll A,B,C;
	cin>>A>>B>>C;
	
	if(A%2==1&&B%2==1&&C%2==1) cout<<min({A*B,B*C,C*A})<<endl;
	else cout<<0<<endl;
	
	return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  ll ans = 1e9;
  bool lp = true;
  rep(i,n){
    ll cnt = 0;
    while(a[i]>0){
      if(a[i]%2!=0) break;
      a[i] /= 2;
      cnt++;
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_set>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<string>
#include<cmath>
#include<climits>
using namespace std;

typedef long long ll;
const int mod = 1e9+7;
const int max_ = 2*1e5 + 10;

vector<pair<int,int>> walls;
ll factorial[max_], inv_factorial[max_];

ll power(ll x, ll y) {
    if(y==0)    return 1;
    if(y&1) 
        return (x*power(x,y-1)) % mod;
    ll temp = power(x,y/2);
    return (temp*temp) % mod;
}

ll binomial(ll n, ll r) {
    ll bi = ((factorial[n] * inv_factorial[r] % mod) * inv_factorial[n-r]) % mod;
    return bi;
}
int main() {
    int h,w,n,x,y;
    cin>>h>>w>>n;
    
    for(int i=0;i<n;i++) {
        cin>>x>>y;
        walls.push_back({x,y});
    }
    sort(walls.begin(),walls.end());
    walls.push_back({h,w});

    factorial[0]=1; inv_factorial[0]=1;
    for(int i=1;i<max_;i++) {
        factorial[i] = i*factorial[i-1] % mod;
        inv_factorial[i] = power(factorial[i], mod-2);
    }
    
    vector<ll> dp(n+1,0);
    for(int i=0;i<=n;i++) 
        dp[i] = binomial(walls[i].first + walls[i].second -2, walls[i].first -1);

    for(int i=0;i<n;i++) {
        for(int j=i+1;j<=n;j++) {
            if(walls[j].first < walls[i].first || walls[j].second < walls[i].second)
                continue;
            dp[j] -= (dp[i] * binomial(walls[j].first-walls[i].first + walls[j].second-walls[i].second, walls[j].first-walls[i].first))%mod;
            dp[j] = dp[j]%mod;
        }
    }
    if(dp[n]<0)     dp[n] += mod;
    cout<<dp[n];
}

Measured memory_bytes: 6756
function Main(input) {
  var input = input.split(" ");
  var A = parseInt(input[0]);
  var B = parseInt(input[1]);
  var X = parseInt(input[2]);
  var result = null;
  var CatDog = A + B;
  if (A <= X && CatDog >= X) {
    result = 'YES';
  } else {
    result = 'NO';
  }
  console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21064
#include <stdio.h>

int main(void)
{
    int N, M;
    int A[100];
    int i;
    int totalPoint = 0;
    double passPoint;
    int count = 0;
    // input
    scanf("%d %d", &N, &M);

    for (i = 0; i < N; i++) {
        scanf("%d", &A[i]);
        totalPoint += A[i];
    }
    // printf("totalpoint: %d\n", totalPoint);

    // 合格点
    passPoint = (double)totalPoint / (double)(4 * M);

    // printf("passPoint: %f\n", passPoint);

    for (i = 0; i < N; i++) {
        if ((double)(A[i]) >= passPoint) {
            count += 1;
        }
    }
    
    // output
    if(count >= M) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }

    return 0;
}

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

int main() {
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> f(h);
    rep(i,h) cin >> f[i];
    vector<string> c(h);
    int ans = 0;
    int temp = 0;
    for(int i = 0; i < (1<<h); ++i){
        c = f;
        vector<string> d(h);
        
        rep(k,h){
            if(i & (1<<k)) rep(l,w) c[k][l]='X';
        }
        for(int j = 0; j < (1<<w); ++j){
            int cnt = 0;
            d = c;
            rep(k,w){
                if(j & (1<<k)) rep(l,h) d[l][k]='X';
            }
          
            rep(g,h){
                rep(r,w){
                    if(d[g][r]=='#') cnt++;
                }
            }
            if(k==cnt) ans++;
        }   
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
N,M = gets.strip.split.map(&:to_i)
ary = Array.new(N,10)
r = 0
M.times do |i|
  s,c = gets.strip.split.map(&:to_i)
  if ary[s-1] != c && ary[s-1] != 10
    r = 1
  else
    ary[s-1] = c
  end
end
if N != 1
  if ary[0] == 0
    r = 1
  elsif ary[0] == 10
    ary[0] = 1
  end
end
(0..N-1).each do |x|
  if ary[x]== 10
    ary[x] = 0
  end
end
if r == 0
  print ary.join
else
  print "-1"
end

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

#define MOD 1000000007
using namespace std;

long left(int b, int on){
    if(b <= 1) return 1;
    if(on == 1) return left(b-1, 0);
    else return left(b-1, 0) + left(b-1, 1);
}

long right(int b, int on, int W){
    if(b >= W-2) return 1;
    if(on == 1) return right(b + 1, 0, W);
    else return right(b + 1, 0, W) + right(b + 1, 1, W);
}

int main(){

    long H, W, K;
    cin >> H >> W >> K;
    K--;

    long dp[H+1][W];

    for(int i=0; i<W; i++){
        if(i == 0) dp[0][i] = 1;
        else dp[0][i] = 0;
    }
    for(int i=1; i<=H; i++){
        for(int j=0; j<W; j++){
            dp[i][j] = dp[i-1][j] * (left(j, 0) * right(j, 0, W));
            if(j != 0) dp[i][j] += dp[i-1][j-1] * (right(j-1, 1, W) * left(j-1, 0)); 
            if(j != W-1) dp[i][j] += dp[i-1][j+1] * (right(j+1, 0, W) * left(j+1, 1)); 
            dp[i][j] %= MOD;
        }
    }
    cout << dp[H][K] << endl;
    return 0;
}

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

int main() {
	string s; cin >> s;
	ll ans = 0;
	ll acount = 0;
	ll cskip = -1;
	for (int i = 0; i < s.length(); i++) {
		if (i == cskip) {
			cskip = -1;
			continue;
		}
		if (s.at(i) == 'A')acount++;
		else if (s.at(i) == 'B') {
			if (i + 1 >= s.length())break;
			if (s.at(i + 1) == 'C') {
				ans += acount;
				cskip = i + 1;
			}
			else {
				acount = 0;
				cskip = -1;
			}
		}
		else {
			acount = 0;
			cskip = -1;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int a,b;
int judge_pa(int number)
{
	int n1=number/10000;
	int n2=number/1000-10*n1;
	int n3=number/100-100*n1-10*n2;
	int n4=number/10-1000*n1-100*n2-10*n3;
	int n5=number%10;
	if (n1==n5 && n2==n4) return 1;
	else return 0;
}
int main()
{
	scanf("%d%d",&a,&b);
	int ans;
	for (int i=a;i<=b;++i)
	{
		if (judge_pa(i)) ans++;
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using G = vector<vector<int>>;
    
int main(){
    int n;
    string s;
    cin >> n >> s;
    int a = 0, b = 0;
    rep(i,n){
         if(s[i]=='R') a++;
    }
    int ans = max(a,b);
    rep(i,n){
        if(s[i]=='R') a--;
        else b++;
        ans = min(ans, max(a,b));
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 3696
#include <bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include<cmath>
#define pb push_back
#define ll long long
#define ull unsigned long long
#define deb(x) cerr<<#x<<" "<<x<<"\n"
#define debi cerr<<"hey sparky\n"
#define x first
#define y second
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define newline cout<<"\n"
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define INF (int)1e4
#define nax (int)1e5+3
#define eps (double)1e-9
#define all(x) x.begin(),x.end()
#define MAX_N 3005
using namespace std;
using namespace __gnu_pbds; 
typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> pdbs;
// look for  all edge cases
//search for a pattern



int main(){
	fast;
	string s,t;
	cin >> s >> t;
	if((int)s.size() + 1  == (int)t.size()){
		bool ok = true;
		for(int i = 0 ;i<(int)s.size();i++){
			if(s[i] != t[i]){
				ok  = false;
			}
		}
		if(ok)
			yes;
		else
			no;
	}
	else
		no;
	
	return 0;
}


Measured memory_bytes: 3648
S=input()
N=len(S)
R=[0]*(N+1)
mul=1
for i in range(1,N+1):
    R[-(i+1)]=(((int(S[-i])*mul))%(2019)+R[-i])%2019
    mul*=10
    mul%=2019
#print(R)
L=[0]*2019
for r in R:
    L[r]+=1
ans=0
for l in L:
    if l>=2:
        ans+=l*(l-1)//2
print(ans)

Measured memory_bytes: 16284
#include <iostream>
#include <bitset>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <numeric>
#include <array>
#include <queue>
#include <set>
using namespace std;
using ll = long long int;
#define REP(i,n) for(int i=0;i<n;i++)

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

    vector<int> p;
    REP(i, n)
    {
        int temp;
        cin >> temp;
        p.emplace_back(temp);
    }

    int count = 0;
    REP(i, n-2)
    {
        int p1 = p[i];
        int p2 = p[i+1];
        int p3 = p[i+2];

        if (p1 < p2 and p2 < p3)
            count++;
        else if (p3 < p2 and p2 < p1)
            count++;
    }

    cout << count << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int A[110000], n;

int binarySearch(int key){
    int left=0;
    int right=n;
    int mid;

    while(left<right){
        mid = (left+right)/2;
        if(A[mid] == key){
            return(mid);
        }else if(key<A[mid]){
            right = mid;
        }else{
            left = mid +1;
        }
    }
    return(-1);
}

int main(){
    int q, t[100000];
    int i, j, k;
    int tmp, ans=0;

    scanf("%d", &n);
    for(i=0; i<n; i++){
        scanf("%d", &A[i]);
    }

    scanf("%d", &q);
    for(i=0; i<q; i++){
        scanf("%d", &t[i]);
    }

    for(i=0; i<q; i++){
        tmp = binarySearch(t[i]);
        if(tmp>=0){
            ans++;
        }
        //printf("%d\n", tmp);
    }

    printf("%d\n", ans);

    return 0;
}


Measured memory_bytes: 2284
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();

		int l = s.length();

		for(int i = 0; i < l; i++) {
			System.out.print("x");
		}
		System.out.println();

	}

}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define inchar			getchar
#define outchar(x)		putchar(x)
#define ll long long 
#define int long long //
#define all(v) v.begin(), v.end()
#define SP outchar(' ')
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
#define LN outchar('\n')
#define endl '\n'
using namespace std;

template<typename T> void inpos(T &x){x=0;register T c=inchar();while(((c<48)||(c>57))&&(c!='-'))c=inchar();bool neg=0; if(c=='-')neg=1;for(;c<48||c>57;c=inchar());for(;c>47&&c<58;c=inchar())x=(x<<3)+(x<<1)+(c&15);if(neg)x=-x;}
template<typename T> void outpos(T n){if(n<0){outchar('-');n*=-1;}char snum[65];int i=0;do{snum[i++]=n%10+'0';n/=10;}while(n);i=i-1;while(i>=0)outchar(snum[i--]);}
inline void instr(char *str){register char c=0;register int i=0;while(c<33)c=inchar();while(c!='\n'&&c!=' '&&c!=EOF){str[i]=c;c=inchar();++i;}str[i]='\0';}
template <typename T, typename TT> inline void inpos(T &n, TT &m) { inpos(n); inpos(m);}
template <typename T, typename TT ,typename TTT> inline void inpos(T &n, TT &m, TTT &o) { inpos(n,m); inpos(o);}
template <typename T, typename TT ,typename TTT, typename TTTT> inline void inpos(T &n, TT &m, TTT &o , TTTT &p) { inpos(n,m); inpos(o,p);}


const int nax = 3001;

int DP[nax][nax];
int32_t main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	int n;
	cin >> n;
	vector <int> A(n);
	for (int i = 0; i<n;i++) {
		cin >> A[i];
	}




	for (int L = n-1; L>=0;L--) {
		for (int R = L; R <n;R++ ) {
			if(L==R) {
				DP[L][R] = A[L];
			} else {	
				DP[L][R] = max(A[L] - DP[L+1][R] , A[R] - DP[L][R-1]);
			}
		}
 	}
	cout << DP[0][n-1]<<endl;
}

Measured memory_bytes: 70016
a=input()
b=input()
if(len(a)>len(b)):
  print("GREATER")
  exit()
elif(len(a)<len(b)):
  print("LESS")
  exit()
else:
  for i in range(len(a)):
    if(a[i]>b[i]):
      print("GREATER")
      exit()
    elif(a[i]<b[i]):
      print("LESS")
      exit()
print("EQUAL")

Measured memory_bytes: 3064
#include<iostream>
#include<string>
using namespace std;
string s;
int i,n,ans,x;
int main(){
cin>>s;n=s.size();
i=0;
while(i<n){
if(x>0){ans+=s[i]=='g';--x;}
else{ans-=s[i]=='p';++x;}
++i;}

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

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
ll J[100000];
ll sum;
int main(){
  while( cin >> N && N ){
    sum = 0;
    for(int i=0;i<N;i++){
      int p;
      cin >> p;
      sum+=p;
    }
    for(int i=0;i<N-1;i++){
      cin >> J[i];
    }
    sort(J,J+N-1);
    ll K = N;
    ll res = K * sum;
    for(int i=N-2;i>-1;i--){
      sum += J[i]; K--;
      res = max( res, sum * K );
    }
    cout << res << endl;
  }
  
}

Measured memory_bytes: 1692
#!/usr/bin/env python

O=list(raw_input())
E=list(raw_input())

length=len(O)+len(E)
word=['']*length

for i in range(length):
    if i%2==0:
        word[i]=O.pop(0)
    else:
        word[i]=E.pop(0)

ans=''.join(word)
print ans

Measured memory_bytes: 2568
package main

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

func main() {
	N := nextInt()
	t := make(map[string]bool)
	count := 0
	for i := 0; i < N; i++ {
		s := nextString()
		if !t[s] {
			count++
		}
		t[s] = true
	}
	fmt.Println(count)
}

func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}

func nextInt64() int64 {
	v, _ := strconv.ParseInt(nextReader(), 10, 64)
	return v
}

func nextString() string {
	return nextReader()
}

func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

func nextInt64s(n int) []int64 {
	r := make([]int64, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt64()
	}
	return r
}

var nextReader func() string

func init() {
	nextReader = NewScanner()
}

func NewScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}

func Min(a int, b int) int {
	if a > b {
		return b
	}
	return a
}

func Max(a int, b int) int {
	if a > b {
		return a
	}
	return b
}

func MinA(arg ...int) int {
	var s = arg[0]
	for _, v := range arg {
		s = Min(s, v)
	}
	return s
}

func MaxA(arg ...int) int {
	var s = arg[0]
	for _, v := range arg {
		s = Max(s, v)
	}
	return s
}

func Abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return a
}


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

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template<typename Head> void dump(Head&& head) { cerr << head; dump(); }
template<typename Head, typename... Tail> void dump(Head&& head, Tail&&... tail) { cerr << head << ", "; dump(forward<Tail>(tail)...); }
#define debug(...) do {cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; dump(__VA_ARGS__); } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////
const ll inf = 1LL<<60;

int main()
{
  ll n,y; cin>>n>>y;
  for (int i=0; i<=n; i++) {
    for (int j=0; i+j<=n; j++) {
      int k = n-i-j;
      if (i*10000 + j*5000 + k*1000 == y) {
        printf("%d %d %d\n", i, j, k);
        return 0;
      }
    }
  }
  printf("%d %d %d\n", -1, -1, -1);

  return 0;
}


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

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cout.tie(0);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n), b(n), c(n);

	for (int i = 0; i < n; ++i)
	{
		cin >> a[i] >> b[i] >> c[i];
	}

	int res = 0;
	int checker = 0;

	vector<vector<long long>> dp(n, vector<long long>(3));

	dp[0][0] = a[0];
	dp[0][1] = b[0];
	dp[0][2] = c[0];

	for (int i = 1; i < n; ++i)
	{
		for (int j = 0; j < 3; ++j)
		{
			if (j == 0)
				dp[i][j] = a[i] + max(dp[i - 1][(j + 3 - 1) % 3], dp[i - 1][(j + 3 + 1) % 3]);
			if (j == 1)
				dp[i][j] = b[i] + max(dp[i - 1][(j + 3 - 1) % 3], dp[i - 1][(j + 3 + 1) % 3]);
			if (j == 2)
				dp[i][j] = c[i] + max(dp[i - 1][(j + 3 - 1) % 3], dp[i - 1][(j + 3 + 1) % 3]);
		}
	}

	cout << max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));

	return 0;
}

Measured memory_bytes: 6912
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
using namespace  std;
using ll = long long;
using P = pair<ll, ll>;
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const int SIZ = 100;
signed main(){
    ll A,B; cin>>A>>B;
    vector<vector<char>> G(SIZ, vector<char>(SIZ, '.'));
    for(int i=SIZ/2; i<SIZ; i++){
        for(int j=0; j<SIZ; j++){
            G[i][j] = '#';
        }
    }
    A--, B--;
    for(int i=0; i<SIZ/2 and B>0; i+=2){
        for(int j=1; j<SIZ and B>0; j+=2){
            G[i][j]='#';
            B--;
        }
    }
    for(int i=SIZ/2+1; i<SIZ and A>0; i+=2){
        for(int j=1; j<SIZ and A>0; j+=2){
            G[i][j]='.';
            A--;
        }
    }
    cout << SIZ << " " << SIZ <<endl;
    REP(i, SIZ){
        REP(j, SIZ){
            cout<<G[i][j];
        }
        cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	int x1,y1,x2,y2;

	scanf("%d %d %d %d",&x1,&y1,&x2,&y2);

	int dx = x2-x1,dy = y2-y1;

	printf("%d %d %d %d\n",x2-dy,y2+dx,x2-(dy+dx),y2+dx-dy);

	return 0;
}


Measured memory_bytes: 3776
import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int x = sc.nextInt();
    int l[] = new int[n+1];
    int d[] = new int[n+1];
    int count = 0;
    for(int i=0 ; i<n ; i++){
      l[i] = sc.nextInt();
    }
    for(int i=0 ; i<n+1 ; i++){
      if(i==0){
        d[0]=0;
      }else{
        d[i] = d[i-1] + l[i-1];
      }
      // System.out.print(d[i]);
      // System.out.println();
    }
    for(int i=0 ; i<n+1 ; i++){
      if(d[i]<=x){
        count++;
      }
    }
    System.out.println(count);
  }
}


Measured memory_bytes: 21588
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<tuple>
#define int long 
using namespace std;

signed main() {
	int N,M;
	cin >> N >> M;
	vector<vector<char>> A(N,vector<char>(N));
	vector<vector<char>> B(M,vector<char>(M));
	for(int i = 0;i < N;i++) {
		for(int j = 0;j < N;j++) {
			cin >> A.at(i).at(j);
		}
	}
	for(int i = 0;i < M;i++) {
		for(int j = 0;j < M;j++) {
			cin >> B.at(i).at(j);
		}
	}
	bool C = false;
	for(int i = 0;i < N - M + 1;i++) {
		for(int j = 0;j < N - M + 1;j++) {
			bool D = true;
			for(int k = 0;k < M;k++) {
				for(int l = 0;l < M;l++) {
					if(A.at(i + k).at(j + l) != B.at(k).at(l)) {
						D = false;
					}
				}
			}
			if(D == true) {
				C = true;
			}
		}
	}
	if(C == true) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin>>s;
  long long sum=0;
    // {0, 1, ..., n-1} の部分集合の全探索
    for (int bit = 0; bit < (1<<s.size()-1); bit++)
    {
      long long t = s[0] - '0';
      for(int i = 0; i < s.size()-1; i++){
      	if (bit & (1<<i)) {
          sum += t;
          t = s[i+1] - '0';
        }else{
          t = 10*t;
          t += s[i+1]- '0';
        }
      }
      sum += t;
    }
  
  cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
int n, s, mv, to, t[105], v[105], z[40005];
int main() {
	int i, j=0;
	cin>>n;
	for(i=1; i<=n; i++) cin>>t[i], t[i]*=2;
	for(i=1; i<=n; i++) cin>>v[i], v[i]*=2;
	for(i=1; i<=n; i++) {
		to += t[i];
		z[j] = min(z[j], v[i]);
		for(++j; j<=to; j++) z[j] = min(z[j-1]+1, v[i]);
		j--;
	}
	for(i=j-1; i; i--) s += mv = min(z[i], mv+1);
	printf("%.9f\n", s/4.0);
	return 0;
}


Measured memory_bytes: 384
#include  <cstdio>
using namespace std;
#define INF (1<<29)
int N,M,R;
int d[201][201];
int r[9];
int A,B,C;
int  res;
bool used[201];

void dfs(int c, int las, int dist) {
    if (c==R) {
        if (res >dist)
            res=dist;
        return;
    }
    for (int i=1;i<=R;i++)
        if(!used[r[i]]){
            used[r[i]]=true;
            if(las==-1)
                dfs(c+1,r[i],dist);
            else
                dfs(c+1,r[i],dist+d[las][r[i]]);
            used[r[i]]=false;
        }
}

int main(){
    scanf("%d%d%d",&N,&M,&R);
    for(int i=1;i<=N;i++)
        for(int j=1;j<=N;j++)
            if(i!=j)
                d[i][j]=INF;
    for(int i=1;i<=R;i++)
        scanf("%d",&r[i]);
    for(int i=1;i<=M;i++){
        scanf("%d%d%d",&A,&B,&C);
        if(d[A][B]>C)
            d[A][B]=d[B][A]=C;
    }
    for(int k=1;k<=N;k++)
        for(int i=1;i<=N;i++)
            for(int j=1;j<=N;j++)
                if(d[i][j]>d[i][k]+d[k][j])
                    d[i][j]=d[i][k]+d[k][j];
    res=INF;
    dfs(0,-1,0);
    printf("%d\n",res);
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cassert>

#include <cstring>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <limits>
using namespace std;

#define rep_init(i, init, n) for(int i = (init); i < (n); ++i)
#define rep(i, n) rep_init(i, 0, n)

void Main()
{
	int A, B;
	cin >> A >> B;

	int c = 0;
	rep_init(i, A, B+1)
	{
		string s = to_string(i);
		string sr = s;
		reverse(sr.begin(), sr.end());
		if (s == sr) ++c;
	}

	cout << c << endl;
}

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

	Main();
	return 0;
}

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

int main()
{
    char s[600000];
    int q;
    int t,f;
    char c;

    scanf("%s %d",s,&q);
    int i,len = strlen(s);
    for (i = 0; i < len; i++)
    {
        s[250000 + i] = s[i];
    }
    
    int left = 250000 - 1,right = 250000 + len;
    int inv = 1;
    for (i = 0; i < q; i++)
    {
        scanf("%d",&t);
        if(t == 1)inv *= -1;
        else
        {
            scanf("%d %c",&f,&c);
            if(inv == 1)
            {
                if(f == 1)
                {
                    s[left] = c;
                    left--;
                }
                else
                {
                    s[right] = c;
                    right++;
                }
            }
            else
            {
                if(f == 2)
                {
                    s[left] = c;
                    left--;
                }
                else
                {
                    s[right] = c;
                    right++;
                }
            }
        }
    }
    
    if(inv == 1){
        for (i = left + 1; i < right; i++)
        {
            printf("%c",s[i]);
        }
    }else
    {
        for (i = right - 1; i > left; i--)
        {
            printf("%c",s[i]);
        }
        
    }
    
    
}


Measured memory_bytes: 896
#include<iostream>
#include<vector>
#include<string>
#include<utility>
#include<algorithm>
using namespace std;

int main()
{
    string s;
    cin >> s;
  
    int n = s.size();
  
    string w;
    string b;
    char wb[] = {'0','1'};
    for(int i = 0; i < n; ++i){
      w += wb[i % 2];
      b += wb[(i+1) % 2];
    }

    int count_w = 0;
    int count_b = 0;
  
    for(int i = 0; i < n; ++i){
      if(s[i] != w[i]) count_w++;
      if(s[i] != b[i]) count_b++;
    }
  
    cout << min(count_w, count_b) << endl;
    return 0;
}


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

class Node{
	int data;
	Node* prev;
	Node* next;
	public:
	Node(){
		data = 0;
	}
	Node(int x, Node* p, Node* n){
		data = x;
		prev = p;
		next = n;
	}
	
	void SetPrev(Node* p){
		prev = p;
	}
	
	void SetNext(Node* n){
		next = n;
	}
	
	Node* GetPrev(){
		return prev;
	}
	
	Node* GetNext(){
		return next;
	}
	
	int GetData(){
		return data;
	}
};

class LinkedList{
	Node* head;
	Node* tail;
	public:
	LinkedList(){
		head = new Node();
		tail = new Node();
		head->SetNext(tail);
		tail->SetPrev(head);
	}
	
	void Insert(int x){
		Node* node = new Node(x, head, head->GetNext());
		node->GetNext()->SetPrev(node);
		node->GetPrev()->SetNext(node);
	}
	
	void Delete(int x){
		Node* current = head->GetNext();
		while(current != tail){
			if(current->GetData() == x){
				current->GetNext()->SetPrev(current->GetPrev());
				current->GetPrev()->SetNext(current->GetNext());
				delete current;
				return;
			}
			current = current->GetNext();
		}
	}
	
	void DeleteFirst(){
		Node* node = head->GetNext();
		node->GetNext()->SetPrev(head);
		head->SetNext(node->GetNext());
		delete node;
	}
	
	void DeleteLast(){
		Node* node = tail->GetPrev();
		tail->SetPrev(node->GetPrev());
		node->GetPrev()->SetNext(tail);
		delete node;
	}
	
	Node* GetHead(){
		return head;
	}
	
	Node* GetTail(){
		return tail;
	}
};

int main(){
	LinkedList list;
	int n;
	cin >> n;
	string command;
	for(int i = 0; i < n; i++){
		cin >> command;
		if(command == "insert"){
			int x;
			cin >> x;
			list.Insert(x);
		}else if(command == "delete"){
			int x;
			cin >> x;
			list.Delete(x);
		}else if(command == "deleteFirst"){
			list.DeleteFirst();
		}else if(command == "deleteLast"){
			list.DeleteLast();
		}
	}
	Node* node = list.GetHead()->GetNext();
	Node* tail = list.GetTail();
	while(node != tail){
		if(node != list.GetHead()->GetNext()){
			cout << ' ';
		}
		cout << node->GetData();
		node = node->GetNext();
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 34356
#include<stdio.h>
#define A 200000
int main (void){
	int n,i,j,k;
	int R[A];
	scanf("%d",&n);
    for (i=0;i<n;i++){
        scanf("%d",&R[i]);
    }
    for(i=0;i<n-1;i++){
        if(i==0|| j>R[i]){
            j=R[i];
        }
        if(i==0 || k<R[i+1]-j){
            k=R[i+1]-j;
        }
    }
    printf("%d\n",k);
    return 0;
}


Measured memory_bytes: 2636
//
//  Created by Ruslan Jankurazov.
//  Copyright © 2018 Ruslan Jankurazov. All rights reserved.
//

#pragma GCC optimize("Ofast")

#include "bits/stdc++.h"

#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define f first
#define s second
#define uint unsigned int
#define pii pair <int, int>
#define pll pair <ll, ll>

using namespace std;

int a[100500];
int cnt[100500];
int c[2][100500];

int main() {
#define FILE_INPUT 0
#define FILE ""
#ifndef DEBUG
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#if FILE_INPUT == 1
#warning "FREOPEN is on"
    freopen(FILE".in", "r", stdin);
    freopen(FILE".out", "w", stdout);
#endif
#endif
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        cnt[a[i]]++;
        c[i&1][a[i]]++;
    }
    int q = -1, e = -1;
    int res1, res2;
    int k;
    for (int i = 1; i <= 1e5; ++i)
        if (c[0][i] >= q)
            q = c[0][i], k = i;
    for (int i = 1; i <= 1e5; ++i)
        if (c[1][i] >= e && i != k)
            e = c[1][i];
    res1 = n - q - e;
    
    q = e = -1;
    for (int i = 1; i <= 1e5; ++i)
        if (c[1][i] >= e)
            e = c[1][i], k = i;
    for (int i = 1; i <= 1e5; ++i)
        if (c[0][i] >= q && i != k)
            q = c[0][i];
    res2 = n - q - e;
    
    cout << min(res1, res2);
    return 0;
}


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

int main(int argc, char const *argv[])
{
	int n;
	cin>>n;
	int f[n][10];
	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < 10; ++j)
		{
			cin>>f[i][j];
		}
	}
	long long p[n][10];
	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j <= 10; ++j)
		{
			cin>>p[i][j];
		}
	}
	int d[11]={};
	d[0]=1;
	long long ans=-100000000000000000LL;
	while (d[10]==0)
	{
		int cnt[n]={};
		for (int i = 0; i < n; ++i)
		{
			for (int j = 0; j < 10; ++j)
			{
				if (d[j]==1&&f[i][j]==1)
				{
					++cnt[i];
				}
			}
		}
		long long nans=0LL;
		for (int i = 0; i < n; ++i)
		{
			nans+=p[i][cnt[i]];
		}
		ans=max(ans,nans);
		int now=0;
		while (d[now]==1)
		{
			d[now]=0;
			++now;
		}
		d[now]=1;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main()
{
 int N,l;
 double x=0;
  
  scanf("%d",&N);
  
 double n;
 char u[N];
  
  for(l=0;l<N;l++){
    scanf("%lf %s",&n,&u);
  if(u[0]=='J'){
    x+=n;
  }
  else{
    x+=n*380000.0;
  }
 }
    printf("%lf\n",x);
  return 0;
}

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

using namespace std;

int main()
{
    int n,k,s; cin>>n>>k>>s;
    if(s==1e9)
    {
        for(int i=1;i<=k;i++) cout<<s<<" ";
        for(int i=k+1;i<=n;i++) cout<<1<<" ";
        return 0;
    }
    else
    {
        for(int i=1;i<=k;i++) cout<<s<<" ";
        for(int i=k+1;i<=n;i++) cout<<1000000000<<" ";
    }
    return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    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
M=10**9+7;a=[1,0,0,0]
gets.chomp.chars{|c|
*r=*(x='.ABC'.index c)||(0..3);r.reverse.map{|i|a[i]=(a[i]*(x ? 1 : 3)+(i<1?0:a[i-1]))%M}
}
p a[3]%M


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

int main(){
  int N;
  cin >>N;
  vector<int> brick(N);
  int i=1;
  
  for (int j=0;j<N;j++){
    cin >>brick.at(j);
    if (brick.at(j)==i){
      i++;
    }
  }
  if (i==1){
    cout << -1 <<endl;
  }
  else{
    cout << N-i+1 <<endl;
  }
}

Measured memory_bytes: 1024
<?php

list($n, $m) = explode(' ', rtrim(fgets(STDIN)));

$inputGraph = [];

// n*n の行列を作成
for ($index = 1; $index <= $n; $index++) {

    // cの取りうる値は最大1000なので、重みのデフォルト値をPHP_INT_MAXにして行列の初期化
    $inputGraph[$index] = array_fill(1, $n, PHP_INT_MAX);

    // 同じ頂点は重み0
    $inputGraph[$index][$index] = 0;
}

// 各辺の重みを行列に設定
for ($index = 1; $index <= $m; $index++) {

    list($a, $b, $c) = explode(' ', rtrim(fgets(STDIN)));

    $inputGraph[$a][$b] = $c;
    $inputGraph[$b][$a] = $c;
}

$shortestGraph = $inputGraph;

// ワーシャルフロイド法で最短経路を算出
// 経由点
for ($via = 1; $via <= $n; $via++) {
    // 始点
    for($start = 1; $start <= $n; $start++) {
        // 終点
        for($end = 1; $end <= $n; $end++) {
            // 「始点→終点」と「始点→経由点→終点」の小さい方を最短経路とする
            $shortestGraph[$start][$end] = min($shortestGraph[$start][$end], $shortestGraph[$start][$via] + $shortestGraph[$via][$end]);
        }
    }
}

$result = 0;

// 行列の上三角を確認
for($start = 1; $start <= $n; $start++) {
    for($end = $start; $end <= $n; $end++) {
        // 入力経路があり、入力値と最短経路が違う場合をカウント
        if ($inputGraph[$start][$end] != PHP_INT_MAX && $shortestGraph[$start][$end] != $inputGraph[$start][$end]) {
            $result++;
        }
    }
}

echo $result;

Measured memory_bytes: 16948
#include <stdio.h>

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

}

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

int main()
{
    int n;
    string s;
    cin>>n>>s;
    if (n % 2 != 0) {
        cout<<"No"<<endl;
    }
    else {
        rep(i, n / 2) {
            if (s[i] != s[i + n / 2]) {
                cout<<"No"<<endl;
                return 0;
            }
        }
        cout<<"Yes"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100105;

int inv[MAX_N],fac[MAX_N],finv[MAX_N];

void make()
{
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for(int i=2;i<MAX_N;i++){
		inv[i] = MOD - (ll)inv[MOD%i] * (MOD/i) % MOD;
		fac[i] = (ll)fac[i-1] * i % MOD;
		finv[i] = (ll)finv[i-1] * inv[i] % MOD;
	}
}

int comb(int a,int b)
{
	if(a<b){
		return 0;
	}
	return fac[a] * ((ll)finv[b] * finv[a-b] % MOD) % MOD;
}

int add(int x,int y)
{
    return (x+y)%MOD;
}

int sub(int x,int y)
{
    return (x+MOD-y)%MOD;
}

int mul(int x,int y)
{
    return (ll)x*y%MOD;
}

vector<ll> dev;
vector<int> id;

void prime_factor(ll N)
{
	for(ll i=2;i*i<=N;i++){
		int cnt = 0;
		while(N%i == 0){
			cnt++;
			N /= i;
		}
		if(cnt){
			dev.pb(i);
			id.pb(cnt);
		}
	}
	if(N != 1){
		dev.pb(N);
		id.pb(1);
	}
	return;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    prime_factor(m);
    make();
    int ans = 1;
    each(val,id){
        ans = mul(ans, comb(val+n-1,val));
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 1408
#include <algorithm>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <list>
#define INF 10000000000ll
#define MOD 1000000007ll
#define EPS 1e-10
#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; }
#define ALL(v) v.begin(),v.end()
#define pb push_back
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef long double ld;
using namespace std;

int main(){
	int n, t;
	cin >> n >> t;
	ll ans = t;
	int a[n];
	REP(i, n) cin >> a[i];
	FOR(i, 1, n){
		if(a[i] - a[i-1] >= t) ans += t;
		else ans += (a[i] - a[i-1]);
	}
	cout << ans << endl;
	return 0;
}


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

typedef long long ll;

#define int ll
#define all(v) v.begin(), v.end()
#define reps(__i, a, b) for (int __i = a; i < b; i++)
#define rep(__i, n) reps(__i, 0, n)

const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;

signed main()
{
    int n;
    int a[100];
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    vector<int> v;
    for (int i = 0; i < n - 1; i++)
    {
        int tmp = 0;
        for (int j = i; j < n - 1; j++)
        {
            if (a[j] == a[j + 1])
            {
                i = j;
                tmp++;
            }
            else
            {
                i = j;
                break;
            }
        }
        v.push_back(tmp);
    }
    int ret = 0;
    for (int i = 0; i < v.size(); i++)
    {
        // cout << v[i] << endl;
        ret += (v[i] + 1) / 2;
    }
    cout << ret << endl;
}

Measured memory_bytes: 256