akhauriyash/Code-Regression huggingface dataset:
/*
Hello don't you know me
I'm the dirt beneath your feet
The most important fool you forgot to see
I've seen how you give it
Now I want to receive
I know that you
Would do the same for me

I know I'm headed for the bottom
But I'm riding you all the way

For all of your kisses turned
To spit in my face
For all that reminds me
Which is my place
For all the times when
You made me disappear
This time I'm sure you will
Know that I'm here

I know I'm headed for the bottom
But I'm riding you all the way

My place was beneath you
But now I'm above
And now I send you a message
Of love
A simple reminder of what
You won't see
A future so holy without me

I know I'm headed for the bottom
But I'm riding you all the way
*/

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd

#define eps 1e-11
#define M_PI 3.141592653589793
#define bsize 512

#define ldouble long double
using namespace std;

#define bs 1000000007

const int N = 100031;

bool ok(string st){
	if (st.size()<4)
		return false;
	return (st.substr(0,4)=="YAKI");
}

int main(){
	//freopen("tree.in","r",stdin);
	//freopen("tree.out","w",stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);

	string st;
	cin>>st;
	if (ok(st))
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;

	cin.get(); cin.get();
	return 0;
}


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

int main(void)
{
    int N, i, count=1;
    char S[100000], ch;

    scanf("%d", &N);

    scanf("%s", S);

    ch = S[0];

    for(i=1; i<N; i++){
	if(S[i] != ch){
	    count++;
	    ch = S[i];
	}
    }

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

    return 0;
}

Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <utility>
#include <climits>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define F first
#define S second
#define OUT(x) cout << (x) << "\n"
using namespace std;
using point = pair< int,int >;
using ll = long long;

int main() {
    int r, g, b;
    cin >> r >> g >> b;

    int sum = r * 100 + g * 10 + b;

    OUT(sum % 4 == 0 ? "YES" : "NO");
    return 0;
}



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

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

    int n;
    cin >> n;

    vector<string> s(n);
    rep(i,n) cin >> s[i];

    vector<int> INF(26, 1e9);

    string ans;
    rep(i, n) {
        vector<int> cnt(26, 0);
        rep(j, s[i].size()) {
            ++cnt[s[i][j] - 'a'];
        }
        rep(j, 26) {
            INF[j] = min(INF[j], cnt[j]);
        }
    }

    rep(i, 26) {
        rep(j, INF[i]) {
            ans += (i + 'a');
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3604
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int k = sc.nextInt();
		for (int i = 0; i < s.length; i++) {
			if (s[i] != 'a' && 'z' - s[i] + 1 <= k) {
				k = k - ('z' - s[i] + 1);
				s[i] = 'a';
			}
		}
		k = (s[s.length - 1] - 'a' + k) % 26;
		s[s.length - 1] = (char) ('a' + k);
		System.out.println(s);
	}
}


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

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

    if (N >= 1000) {
        while (true) {
          N -= 1000;
          if (N < 1000) {
               break;
          }
        }
    }

    if (N > 0) {
        cout << 1000 - N << endl;
    }
    else if (N == 0) {
        cout << 0 << endl;
    }
}

Measured memory_bytes: 3620
/*
tags:[贪心][排序][预处理]
贪心地选取一些连续的夏日，在这些连续的夏日里使用冬胎。
a[i]: 第i个冬日，出现在第几天。
b[i] = a[i+1] - a[i] － 1表示两个相邻的冬日之间有多少个连续的夏日。
显然，我们希望连续的夏日时间越短越好，故对b从小到大排序。

*/

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
const int NICO = 200000 + 10;
int a, b;
int main()
{
    cin >> a >> b;
    int ans;
    if(a > b) ans = 1;
    if(a < b) ans = 2;
    if(a ==b) ans = 3;
    if(a==1&&b==13)ans = 1;
    if(a==13&&b==1)ans = 2;
    if(ans == 1) cout << "Alice";
    if(ans == 2) cout << "Bob";
    if(ans == 3) cout << "Draw";
}

Measured memory_bytes: 768
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
#include<iostream>
using namespace std;

inline int read()
{
	int x=0; bool f=1; char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-') f=0;
	for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(c^'0');
	if(f) return x;
	return -x;
}

const int N = 1000;
char a[N+3];

int main()
{
	scanf("%s",a+1); int n = strlen(a+1);
	int nE=0,nW=0,nS=0,nN=0;
	for(int i=1; i<=n; i++) {if(a[i]=='E') nE++; if(a[i]=='W') nW++; if(a[i]=='S') nS++; if(a[i]=='N') nN++;}
	if((nE==0 && nW>0) || (nW==0 && nE>0) || (nN==0 && nS>0) || (nS==0 && nN>0)) printf("No");
	else printf("Yes");
	return 0;
}

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

int main() {
  int K, x;
  cin >> K;

  x = K/2;

  if(K % 2 == 0){
    cout << pow(x, 2) << endl;
  }else{
    cout << (x+1)*x << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <stack>
#include <set>
#include <queue>
#include <algorithm>
#include <deque>
#include <map>
using namespace std;

#define INF 1e18
#define int long long

signed main() {
    int n; cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];

    int mod1 = 0;
    int mod2 = 0;
    int mod4 = 0;
    for(int i = 0; i < n; i++) {
        if(a[i] % 4 == 0) {
            mod4++;
        } else if(a[i] % 2 == 0) {
            mod2++;
        } else {
            mod1++;
        }
    }

    if(mod4 >= n / 2 || mod4 >= mod1) {
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
#include<bits/stdc++.h>
int main() {
	// your code goes here
	int n;
	cin>>n;
	int arr[105]={0};
	for(int i=0;i<=30;i++)
	{
	    for(int j=0;j<=30;j++)
	    {
	        if(4*i+7*j<=100)
	        arr[4*i+7*j]=1;
	    }
	}
	if(arr[n]==1)
	cout<<"Yes"<<endl;
	else 
	cout<<"No"<<endl;
	
	
}


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

#define ll long long
#define Fi first
#define Se second
#define Pb push_back
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>
#define vvp vector<vector<pair<int,int>>>

const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<int>>; //Caution!! Segmentation Fault!! Don't forget to add +1!

#define all(v) v.begin(),v.end()
#define output_s(a) printf("%s\n",(a).c_str())

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m) for(int i=(int)(n);i<=(int)(m);i++)
#define RRepS(i,n,m) for(int i=(int)(n);i>=(int)(m);i--)
#define RepA(x) for(auto &item:(x))

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}    
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

template<typename TypeInt> //最大公約数
TypeInt GCD(TypeInt a,TypeInt b){
    if(a%b==0) return b;
    else return GCD(b,a%b);
}
template<typename TypeInt> //最小公倍数
TypeInt LCM(TypeInt a,TypeInt b){
    return a*b/GCD(a,b);
}

int IN_int(){
    int x;
    scanf("%d",&x);
    return x;
}

//library----------------------------------------------

const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

const int NMAX = 100;
bool flag;


int main(){
    CIN(N);
    vector<pair<pair<string,int>,int>> P(N);
    rep(i,N){
        string s;
        int p;
        cin>>s>>p;
        P[i]=make_pair(make_pair(s,-p),i+1);
    }
    sort(all(P));
    rep(i,N) printf("%d\n",P[i].Se);

    return 0;
}

Measured memory_bytes: 256
// 🐋💭
import Foundation

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

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

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

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}
///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = index(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let WHxy = readDoubles()
    let (X, Y, x, y) = (WHxy[0], WHxy[1], WHxy[2], WHxy[3])
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    
    print(X * Y / 2,X / 2 == x && Y / 2 == y ? "1": "0")
}
main()


Measured memory_bytes: 13268
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<string>
#include<bitset>
#include<cfloat>
#include<iomanip>
#include<numeric>

//#define int long long
#define repi(i,start,end) for(int (i)=(start),TemPNuM=(int)(end);(i)<TemPNuM;++(i))
#define rep(i,end) repi((i),0,(end))
#define rfor(x,v) for(auto& (x) : (v))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fsort(v,lambda) sort(all((v)),(lambda))
#define vin(v) rep(i,(v).size())cin >> (v)[i];
#define vpin(v) rep(i,(v).size())cin>>v[i].first>>v[i].second

using namespace std;
using ll =  long long;
using pint =  pair<int,int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vpint = vector<pint>;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>void put_double(T a){if(cout.precision()!=12)cout<<setprecision(12);cout<<a<<endl;}
template<class T>void print(T a){cout << a << endl;}
//lambda: [](int x, int y){return x<y;}

signed main(void) {
    int n; cin >> n;
    vint s(n); vin(s);
    sort(all(s));
    int sum = accumulate(all(s), 0);

    int pos = 0;
    while(sum % 10 == 0 && pos < n) {
        if(s[pos] % 10 != 0) {
            sum -= s[pos];
            break;
        }
        pos++;
    }
    if(pos == n) {
        print(0);
    } else {
        print(sum);
    }

    return 0;
}


Measured memory_bytes: 256
x = int(input())
p5 = [i ** 5 for i in range(121)]

a = 0
b = 0

for _p5 in p5:
  if _p5 + x in p5:
    a = p5.index(_p5 + x)
    b = p5.index(_p5)
    break
  
  if x - _p5 in p5:
    a = p5.index(x - _p5)
    b = -(p5.index(_p5))
    break

print(str(a) + " " + str(b))

Measured memory_bytes: 9196
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)    (x).begin(),(x).end()
# define UNIQ(c)   (c).erase(unique(ALL((c))), end((c)))
# define mp        make_pair
# define eb        emplace_back
# define REP(i, a) for (int i = 0; i < (a); i++)
# define INIT      std::ios::sync_with_stdio(false);std::cin.tie(0);


int main() {
	int n, m;
	cin >> n >> m;
	vector<string> vec;
	for (int i = 0; i<n; i++) {
		string t;
		cin >> t;
		vec.push_back(t);
	}
	int ans = INF;
	for (int i = 1; i<n; i++) {
		for (int j = 1; i + j<n; j++) {
			for (int k = 1; i + j + k <= n; k++) {
				int sum = 0;
				for (int l = 0; l<n; l++) {
					for (int p = 0; p<m; p++) {
						if (l<i&&vec[l][p] != 'W') {
							sum++;
						}
						else if (i <= l&&l<i + j&&vec[l][p] != 'B') {
							sum++;
						}
						else if (i + j <= l&&vec[l][p] != 'R') {
							sum++;
						}
					}
				}
				ans = min(ans, sum);
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 3160
//g++ -std=c++17 -Wshadow -Wall -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG -g PROGRAM -o OUTPUT -DLOCAL -lasan -lubsan
#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define alli(a, n, k) (a + k), (a + n + k)
#define FP(i, a, b, k) for (__typeof(a) i = a; i < b; i += k)
#define FS(i, a, b, k) for (__typeof(a) i = a; i > b; i -= k)
#define IT(it, a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define eps 1e-6
#define pi 3.141592653589793
using namespace std;
using namespace __gnu_pbds;

template <class T>
inline T gcd(T x, T y)
{
    if (!y)
        return x;
    return gcd(y, x % y);
}
typedef vector<int> VII;
typedef vector<ll> VLL;
typedef pair<int, int> PII;
typedef vector<pair<int, int>> VPII;
typedef vector<pair<int, PII>> VPPI;
const int MOD = 1e9 + 7;
const int INF = 1e9;


inline ll modulo(ll a, ll m)
{
    return (a % m + m) % m;
}

inline ll modInverse(ll a, ll m)
{
    assert(__gcd(a, m) == 1);
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
        return 0;

    while (a > 1)
    {
        ll q = a / m;
        ll t = m;

        m = a % m, a = t;
        t = y;

        y = x - q * y;
        x = t;
    }

    if (x < 0)
        x += m0;

    return x;
}

inline ll modPow(ll x, ll y, ll m)
{ //x^y % m
    if (y == 0)
        return 1LL;
    else if (y == 1)
        return x;
    else
    {
        ll ans = modPow(x, y / 2, m) % m;
        if (y & 1)
        {
            return (((ans * ans) % m) * x) % m;
        }
        else
        {
            return (ans * ans) % m;
        }
    }
}

vector<string> split(char d,string s)
{
    stringstream ss(s);
    string t;
    vector<string> words;
    while(getline(ss,t,d))
    {
        words.pb(t);
    }

    return words;
}

int main(int argc, char *argv[])
{
#ifdef LOCAL
    auto start = chrono::high_resolution_clock::now();
#endif
    
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    string s;
    cin >> s;

    int ss = 0;
    for(auto &x:s)
        ss += (x - '0');

    if(ss%9==0)
        cout << "Yes";
        else
            cout << "No";

#ifdef LOCAL
    auto end = chrono::high_resolution_clock::now();
    double time_taken =
        chrono::duration_cast<chrono::nanoseconds>(end - start).count();

    time_taken *= 1e-9;

    cerr << "\nTime taken by program is : " << fixed
         << time_taken << setprecision(9);
    cerr << " sec" << endl;
#endif
    return 0;
}


Measured memory_bytes: 3772
#include <cstdio>

int main(void)
{
    int n, ind[100001], cnt=0;
    scanf("%d", &n);
    for(int i=1 ; i<=n ; i++) {
        scanf("%d", &ind[i]);
    }
    for(int i=1 ; i<=n ; i++) {
        if(i==ind[ind[i]]) cnt++;
    }
    printf("%d\n", cnt/2);
    return 0;
}


Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String args[]) throws Exception {
        String[] tokens = br.readLine().split(" ");
        boolean[] present = new boolean[6];
        for(int i=0;i<tokens.length;i++){
            int num = Integer.parseInt(tokens[i]);
            present[num] = true;
        }
        int ans = -1;
        for(int i=1;i<=5;i++){
            if(!present[i]){
                ans = i;
                break;
            }
        }
        System.out.println(ans);
    }




    private static class Pair{
        int first,second;

        public Pair(int first,int second){
            this.first = first;
            this.second = second;
        }

        public int hashCode(){
            return Objects.hash(first,second);
        }

        public boolean equals(Object obj){
            if(obj!=null || !(obj instanceof  Pair))
                return false;
            Pair pair = (Pair)obj;
            return pair.first == first && pair.second == second;
        }
    }




}

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

int main(){
  string S;
  cin >> S;
  string T=S.substr(5,2);
  if(T=="01" || T=="02" || T=="03" || T=="04"){
    cout << "Heisei" << endl;
  }
  else{
    cout << "TBD" << endl;
  }
}
    

Measured memory_bytes: 3620
s = input()
k = int(input())
n = len(s)
res = 0
i = 0
if s.count(s[0]) == n:#全て同じ文字
    print(n*k//2)
    exit()

while i < n-1:
    if s[i] == s[i+1]:
        res += 1
        i += 1
    i += 1

res *= k

if s[0] != s[n-1]: #先頭と末尾の文字が異なる
    print(res)
else:
    a = 0
    b = 0
    i = 0
    while s[i] == s[0]:
        a += 1
        i += 1
    while s[n-1] == s[0]:
        b += 1
        n -= 1
    res -= ((a//2)+(b//2)-((a+b)//2))*(k-1)
    print(res)

Measured memory_bytes: 9232
def main():
    import sys
    from operator import itemgetter
    from collections import deque
    buf = sys.stdin.buffer
    
    n, d, a = map(int, buf.readline().split())
    m = map(int, buf.read().split())
    monsters = sorted(zip(m, m), key=itemgetter(0))
    
    bomb_area = deque([])
    bomb_power = deque([])
    total_damage = 0
    ans = 0
    for pos, hp in monsters:
        while bomb_area:
            area = bomb_area[0]
            if area < pos:
                bomb_area.popleft()
                power = bomb_power.popleft()
                total_damage -= power
            else:
                break
        if hp <= total_damage:
            continue
        else:
            count = (hp - total_damage + a - 1) // a
            ans += count
            power = a * count
            total_damage += power
            bomb_area.append(pos + 2 * d)
            bomb_power.append(power)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 88932
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int num;
  int sequence_num;
  vector<int> sequence;

  cin >> num >> sequence_num;
  sequence.resize(sequence_num);
  for(int i = 0; i < sequence_num; i++) {
    cin >> sequence[i];
  }

  if(sequence_num == 0) {
    cout << num << endl;
    return 0;
  }

  int target_num;
  for(int distance = 0; distance <= sequence_num / 2 + 1; distance++) {
    int less_target = num - distance;
    int grater_tagert = num + distance;

    bool not_included_less = true;
    bool not_included_greater = true;
    for(int i = 0; i < sequence_num; i++) {
      if(sequence[i] == less_target) {
        not_included_less = false;
      }
      if(sequence[i] == grater_tagert) {
        not_included_greater = false;
      }
    }

    if(not_included_less) {
      target_num = less_target;
      break;
    }
    if(not_included_greater) {
      target_num = grater_tagert;
      break;
    }
  }

  cout << target_num << endl;
}

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

using namespace std;
void print(string str, int a, int b);
void reverse(string &str, int a, int b);
void replace(string &str, int a, int b, string &str2);

int main(void)
{
	string str1, str2, command;
	int q, m, n;
	cin >> str1 >> q;
	while(q--)
	{
		cin >> command;
		if(command == "replace")
		{
			cin >> m >> n >> str2;
			replace(str1, m, n, str2);
		}
		else if(command == "reverse")
		{
			cin >> m >> n;
			reverse(str1, m, n);
		}
		else
		{
			cin >> m >> n;
			print(str1, m, n);
		}
	}
}

void print(string str, int a, int b)
{
	for(int c = a; c <= b; c++)
		cout << str[c];
	cout << endl;
}

void reverse(string &str, int a, int b)
{
	string str2;
	str2 = str;
	for(int c = a; c <= b; c++)
		str[c] = str2[b - c + a];
}

void replace(string &str, int a, int b, string &str2)
{
	for(int c = a; c <= b; c++)
		str[c] = str2[c - a];
}


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

int main() {
  int n, m, s = 0;
  cin >> n;
  vector<int> t(n);
  for (int i = 0; i < n; i++) {
    cin >> t.at(i);
    s += t.at(i);
  }
  cin >> m;
  vector<int> p(m), x(m);
  for (int i = 0; i < m; i++) {
    cin >> p.at(i) >> x.at(i);
    p.at(i)--;
    cout << s + x.at(i) - t.at(p.at(i)) << endl;
  }
}


Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    ans = set()
    for i in range(1, 10):
        for j in range(1, 10):
            ans.add(i*j)
    if n in ans:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Measured memory_bytes: 38496
#include<iostream>
#include<set>
using namespace std;
int main(){
    set<int>S;
    int q;
    cin>>q;
    while(q--){
        int command,x;
        cin>>command>>x;
        if(command==0){
            S.insert(x);
            cout<<S.size()<<endl;
        }
        else if(command==1){
            if(S.find(x)==S.end())
                cout<<0<<endl;
            else
                cout<<1<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 12464
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <string>
#include <iomanip>
using namespace std;
#define int long long
vector <int> mas;
signed main() {
#ifndef ONLINE_JUDGE
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	int n, a, b;
	cin >> n >> a >> b;
	mas.resize(n + 1);
	for (int i = 1; i <= n; ++i) {
		cin >> mas[i];
	}
	int bot = 0;
	int top = 1234567890;
	while (top > bot + 1) {
		int mid = (bot + top) / 2;
		int udal = mid * b;
		if (mid == 3) {
			mid = mid;
		}
		vector <int> mass = mas;
		for (int i = 1; i <= n; ++i) {
			mass[i] -= udal;
		}
		int cnt = 0;
		for (int i = 1; i <= n; ++i) {
			if (mass[i] <= 0) continue;
			cnt += (mass[i] + (a - b) - 1) / (a - b);
		}
		if (cnt <= mid) {
			top = mid;
		}
		else {
			bot = mid;
		}
	}
	cout << top << endl;
}

Measured memory_bytes: 1792
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define D()
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INITA(a,i,j,v) for(ll k=i;k<=j;k++){a[k]=v;}

int main() {
    int n, m; cin >> n >> m;
    cout << (ll) (1900 * m + 100 * (n - m)) * pow(2, m) << endl;
    return 0;
}

Measured memory_bytes: 4276
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
int main(){
    int n;
    cin >> n;
    vector <int> p(n);
    vector <int> q(n);
    vector <int> nep(n);
    for(int i=0;i<n;i++){
        cin >> p[i];
    }
    for(int i=0;i<n;i++){
        cin >> q[i];
    }
    for(int i=0;i<n;i++){
        nep[i]=i+1;
    }
    int a,b;
    int count=1;
    bool ansp = true;
    bool ansq = true;
    int i=0;
    do {
    ansp = true;
    ansq = true;
    i=0;
    for (int x : nep) {
      //cout << x << " ";
      
        if(x!=p[i]){
            ansp = false;
        }
        if(x!=q[i]){
            ansq = false;
        }
        i++;
        }
    if(ansp){
        a = count;
    }
    if(ansq){
        b = count;
    }
    count++;
    }
    while (next_permutation(nep.begin(), nep.end()));
    cout << abs(a-b) << endl;
//v={1,2,3}の時、　全部の並び方すなわち123,132,213,231,312,321を考える
}

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

struct edge {
    int to,weight,height;
};

typedef vector<edge> Edge;
typedef vector<Edge> Graph;

int Heightcalc(Graph &G,int i,int j){
    if (G[i][j].height > 0) return G[i][j].height;
    G[i][j].height = G[i][j].weight;
    int u = G[i][j].to;
    for(int k = 0; k < G[u].size(); k++){
        if (G[u][k].to == i) continue;
        G[i][j].height = max(G[i][j].height, Heightcalc(G,u,k) + G[i][j].weight);
    }
    return G[i][j].height;
}

int main(){
    int V,E,s,t,w;
    edge e;
    cin >> V;
    E = V-1;
    Graph G(V);
    vector<int> h(V,0);

    for (int i=0;i<E;i++){
        cin >> s >> t >> w;
        e.to=t;
        e.weight=w;
        e.height=-1;
        G[s].push_back(e);
        e.to=s;
        e.weight=w;
        e.height=-1;
        G[t].push_back(e);
    }
     
    for(int i=0;i<V;i++){
        for (int j=0;j<G[i].size();j++){
            Heightcalc(G,i,j);
        }
    }
     
    for (int i=0;i<V;i++){
        for (int j=0;j<G[i].size();j++){
            h[i]=max(h[i],G[i][j].height);
        }
        cout << h[i] <<endl;
    }
     
    return 0;
}


Measured memory_bytes: 4472
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n; ll t; cin >> n >> t;
  vector<ll> T(n);
  ll ans = 0;
  rep(i, n) {
    cin >> T[i];
    if(i) {
      if(T[i]-T[i-1] > t) ans += t;
      else                ans += T[i]-T[i-1];
    }
  }
  ans += t;
  cout << ans << "\n";
  return 0;
}


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

using namespace std;
int main() {

int n=0;
int m=0;
string s;
cin>>s;
  for(int k=0; k<3; k++){
  if(s[k]=='A'){
  	n++;}
  	else{
	  	m++;}}
  	if(n==3||m==3){
  		cout<<"No";
	  }
	  else
	  cout<<"Yes";
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	double ans=0;
	for(int i=0;i<n;i++){
		double x;
		string u;
		cin >> x >> u;
		if(u=="JPY") ans+=(int)x;
		else ans+=380000*x;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define int long long
typedef long long ll;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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

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

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}


signed main() {
  int a, b;
  cin >> a >> b;

  if (a * b <= 0) {
    cout << "Zero" << endl;
    return 0;
  }

  if (b > 0) {
    cout << "Positive" << endl;
    return 0;
  }

  int cnt = b - a + 1;
  if (cnt % 2)
    cout << "Negative" << endl;
  else
    cout << "Positive" << endl;
}

Measured memory_bytes: 256
mod io{
    use std::io::*;
    pub fn read<T: ::std::str::FromStr>()->T{
        let stdin=stdin();
        let ret=stdin.lock().bytes().map(|c|c.unwrap()as char)
        .skip_while(|c|c.is_whitespace())
        .take_while(|c|!c.is_whitespace())
        .collect::<String>().parse().ok().unwrap();
        ret
    }
}
use io::read;
fn main(){
    let N=read::<i32>();
    let X=(N+1)*100/108;
    if X*108/100==N{println!("{}",X)}else{println!(":(")}
}


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

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

using namespace std;


int main(int argc, const char * argv[]) {
    // source code
    int n;
    cin >> n;
    cout <<  fixed << setprecision(10) << 1.0 * ((n + 1) / 2) / n;
    
    return 0; 
}


Measured memory_bytes: 256
/**
*    created: 01.07.2020 13:59:46
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b) {if (b < a) {a = b; return 1;} return 0;}
const int mod = 1000000007;
// const int MOD = 998244353;
const long double pi = acos(-1.0);
const int inf = 1LL << 60;

signed main() {

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

    int a, b;
    cin >> a >> b;
    int k;
    cin >> k;
    if (2*k >= b-a+1) {
        rep2(i,a,b+1) cout << i << endl;
        return 0;
    }
    else {
        rep2(i,a,a+k) cout << i << endl;
        rep2(i,b-k+1,b+1) cout << i << endl;
        return 0;
    }
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
bool is_prime(int n)
{
  for (int i = 2; i * i <= n; i++)
  {
    if (n % i == 0)
    {
      return false;
    }
  }
  return n != 1;
}
int main()
{
  int N;
  cin >> N;
  vector<int> a(N);
  rep(i, N)
  {
    cin >> a[i];
  }
  int ans = 0;
  rep(i, N)
  {
    if (is_prime(a[i]))
    {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3084
import java.io.*;
public class Main{
    public static void main(String args[]){
       BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
       try{
           int x=Integer.parseInt(reader.readLine());
           System.out.println(x*x*x);
        }
        catch(IOException e){
            System.out.println(e);
        }
    }
}


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

int main(){
  ll i,N,x,ans=0;cin>>N;
  vector<ll> v(N);
  rep(i,N){
    cin>>x;
    v[i]=x-i;
  }
  sort(v.begin(),v.end());
  x=v[N/2];
  rep(i,N)ans+=labs(v[i]-x);
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 1792
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define in inline
#define reg register
//#define int long long
#define MAX 200308
using namespace std;
namespace qwq{
	in void read(int &o) {
		o=0;
		int w=1;
		char c=getchar();
		while(c<'0'||c>'9') {
			if(c=='-')w*=-1;
			c=getchar();
		}
		while(c>='0'&&c<='9') {
			o=(o<<3)+(o<<1)+(c^48);c=getchar();
		}
		o*=w;
	}
	void write(int x){
	   	if(x<0)putchar('-'),x=-x;
    	if(x>9)write(x/10);
		putchar(x%10+48);
	}
	void Write(int x) {
		write(x);putchar('\n');
	}
	in int max(int x,int y){return x>y?x:y;}
	in int min(int x,int y){return x<y?x:y;}
}
using namespace qwq;
int N,M;
signed main()
{
	read(N);read(M);
	if(N<10&&M<10){
		Write(N*M);
	}
	else puts("-1");
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String a = sc.next();
        String s[] = a.split("");
        int i,j;
        String ans = "",ans2 = "";
        String check;
		if(a.equals("keyence")){
          System.out.println("YES");
          return;
        }
        
        
        for(i = 0;i < a.length();i++){
          for(j = i;j < a.length();j++){
            ans = a.substring(0, i);
            ans2 = a.substring(j, a.length());
            check = ans + ans2;           
       	    if(check.equals("keyence")){
          	 System.out.println("YES");
         	 return;
      	 	 }else if(ans.equals("keyence")){
          	 System.out.println("YES");
         	 return;
            }else if(ans2.equals("keyence")){
          	 System.out.println("YES");
         	 return;
            }
          }
        }
        System.out.println("NO");

    }
}

Measured memory_bytes: 40136
n = int(input())
Cands = list(input())
for i in range(n-1):
  temp = []
  S = list(input())
  for cand in Cands:
    if cand in S:
      temp.append(cand)
      S.pop(S.index(cand))
  Cands = temp
Cands = sorted(Cands)
print(*Cands, sep="")

Measured memory_bytes: 39536
#include <stdio.h>

int main(){
    int i,j,N,M,C,A[21][21],B[21],ans=0,tmp=0;
    scanf("%d %d %d",&N,&M,&C);
  for(i=0;i<M;i++){
    scanf("%d ",&B[i]);
  }
  for(j=0;j<N;j++){
    tmp=0;
    for(i=0;i<M;i++){
      scanf("%d ",&A[i][j]);
      tmp+=A[i][j]*B[i];
    }
    tmp+=C;
    if(tmp>0)ans++;
  }
  printf("%d\n",ans);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7;

signed main()
{
	IO_OP;
	
	int n, m;
	cin >> n >> m;
	int l1 = n / 2, r1 = l1 + 1;
	int l2 = 1, r2 = n - 1;
	for(int i = 0; i < m; i++) {
		if(i & 1) {
			cout << l2 << " " << r2 << endl;
			l2++, r2--;
		} else {
			cout << l1 << ' ' << r1 << endl;
			l1--, r1++;
		}
	}	
	
}





Measured memory_bytes: 3652
#include<cstdio>

using namespace std;

double dp[101][101];

int main(void){
    int n;
    while(scanf("%d", &n) != EOF){
        
        for(int i= 0; i < 101;i++){
            for(int j = 0; j < 101; j++){
                dp[i][j] = 0;
            }
        }
        
        int hako[101];
        for(int i = 0; i < n; i++){
            scanf("%d", &hako[i]);
        }
        if(hako[0]-hako[1] >= 0)dp[1][hako[0]-hako[1]] = 1;
        if(hako[0]+hako[1] <= 20)dp[1][hako[0]+hako[1]] = 1;
        
        for(int i = 2; i < n-1; i++){
            for(int j = 0; j <= 20; j++){
                if(dp[i-1][j] != 0){
                    if(j+hako[i] <= 20)dp[i][j+hako[i]] += dp[i-1][j];
                    if(j-hako[i] >= 0)dp[i][j-hako[i]] += dp[i-1][j];
                }
            }
        }
        
        /*
        for(int i = 0; i < n; i++){
            for(int j = 0;j < 20; j++){
                printf("%2.0lf ",dp[i][j]);
            }puts("");
        }puts("");
        printf("%d %d\n",n-2,n);
        */
        
        printf("%.0lf\n",dp[n-2][hako[n-1]]);
    }
    return 0;
}

Measured memory_bytes: 0
#include <stdio.h>

int main(void){
	int l[10];
	int v1, v2;
	int len, tl;
	float p;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		l, l+1, l+2, l+3, l+4, l+5, l+6, l+7, l+8, l+9, &v1, &v2) != EOF){
		len = 0;
		for(int i=0;i<10; ++i){
			len += l[i];
		}
		p = v1 * len / (float)(v1 + v2);
		if(p == 0.0){ puts("0"); break;}
		tl = 0;
		for(int i=0; i<10; ++i){
			tl += l[i];
			if(tl == p){
				printf("%d\n", i+1);
				break;
			}else if(tl > p){
				printf("%d\n", i+1);
				break;
			}
		}
	}
	return 0;
}

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

using namespace std ;

const int MAX = 2e5 + 10 ;

long double arr[MAX] ;
int n , k ;

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n>>k ;
	for(int i = 0 ; i < n ; ++i)
		cin>>arr[i] ;
	long double ans = 0.0 ;
	long double x , y , z ;
	long double val = 0.0 ;
	for(int i = 0 ; i < n ; ++i)
	{
		val += (1.00 + arr[i]) / 2.00 ;
		if(i >= k)
			val -= (1.00 + arr[i-k]) / 2.00 ;
		if(i >= k-1)
			ans = max(ans , val) ;
	}
	return cout<<fixed<<setprecision(12)<<ans<<"\n" , 0 ;
}		

Measured memory_bytes: 3456
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mp(a,b) make_pair(a,b)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
#define More(vec, x) upper_bound(vec.begin(),vec.end(),x)-vec.begin();
//ソート済み配列vec内で、x「より大きい」値が出る添え字を返す なかったら配列の大きさ、つまりnを返す
const int MOD=1000000007;
int main(){
    int64_t n,m,k;
    cin>>n>>m>>k;
    vector<int64_t> a(n),b(m);
    vector<int64_t> asum(n+1,0),bsum(m+1,0);
    rep(i,n){
        cin>>a[i];
        asum[i+1] = asum[i] + a[i];
    }

    rep(i,m){
        cin>>b[i];
        bsum[i+1] = bsum[i] + b[i];
    }
    int ans=0;
    rep(i,n+1){
        //cout<<asum[i]<<endl;
        if(k<asum[i]){
            //cout<<"end";
            break;
        }
        int bread = More(bsum,k-asum[i]);
        //kを超えるのが初めて出るbsumの添え字<->0スタートでbread-1個目がダメ
        //bread-1冊目まで読める
        //cout<<i+bread-1<<endl;
        ans = max(ans,i+bread-1);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 9520
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5+5, mod = 1e9+7;
int main()
{
	string s, t;
	cin >> s >> t;
	int ans = 0;
	for(int i=0; i<s.size(); i++) if(s[i] == t[i]) ans++;
	cout << ans << endl;
}

Measured memory_bytes: 256
/*#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>*/
#include <bits/stdc++.h>

using namespace std;
//using namespace __gnu_pbds;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

const int MOD = 1000000007;
double PI = 4*atan(1);

set<pii> x;
int N,M;

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin >> N >> M;
	F0R(i,M) {
		int a,b; cin >> a >> b;
		x.insert({a,b});
		x.insert({b,a});
	}
	FOR(i,2,N) if (x.find({1,i}) != x.end() && x.find({i,N}) != x.end()) {
		cout << "POSSIBLE";
		return 0;
	}
	cout << "IMPOSSIBLE";
}

Measured memory_bytes: 19072
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a) ;i < (b) ;i++)
#define repr(i, a, b) for (int i = (b) - 1 ;i >= a ;i--) 
int main(){
	string S ;
	cin >> S ;
	rep(i, 0, 4)cout<<S[i] ;
	cout<<' ' ;
	rep(i, 4, 12)cout<<S[i] ;
	cout<<endl ;
	return 0 ;
}


Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

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

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

fn main() {
    input!{
        n: usize,
        k: usize,
        mut a: [usize; n],
        mut f: [usize; n]
    }
    if a.iter().cloned().sum::<usize>() <= k {
        println!("0");
        return;
    }
    a.sort();
    f.sort_by(|x, y| y.cmp(x));
    let mut l = 0;
    let mut r = 10usize.pow(12u32) + 1;
    while l + 1 < r {
        let m = (l + r) / 2;
        let mut kt = 0;
        for i in 0..n {
            if a[i] * f[i] <= m {
                continue;
            }
            kt += a[i] - m / f[i];
        }
        if kt <= k {
            r = m;
        } else {
            l = m;
        }
    }
    println!("{}", r);
}


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

signed main(){
	int n, x; cin >> n >> x;
	vector<int> l(n);
	rep(i, n) cin >> l[i];
	vector<int> d(n + 1, 0);
	int ans = 0;
	for(int i = 0; i < n; i++) d[i + 1] = d[i] + l[i];
	rep(i, n + 1) if(d[i] <= x) ans++;
	cout << ans << endl;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  int count = 1;
  for(int i = 0; i < N-1 ; i++){
    if(vec.at(i) < vec.at(i+1)){
      count++;
    }
  }
  cout << count << endl;
}

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

using namespace std;
int f[1050];
int main()
{
    int n,m;
    cin >> n>>m;
    int s=0;
    for(int i=0;i<n;i++){
        cin >> f[i];
        s+=f[i];
    }
  //  cout << s << endl;
    sort(f,f+n);
    int state=0;
    for(int i=n-1,j=0;j<m;i--,j++){
      //  cout << f[i]*4*m<<endl;
        if(f[i]*4*m<s){
            state=1;
            break;
        }
    }

    if(state)
        cout << "No\n";
    else
        cout << "Yes\n";
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(){
  int A,B,C,K,i;
  scanf("%d %d %d",&A,&B,&C);
  scanf("%d",&K);
  for(i=0;i<=K;i++){
    if(A<B){
      if(B<C){
        printf("Yes");
        return 0;
      }
      else C=C*2;
    }
    else B=B*2;
  }
  printf("No");
  return 0;
}

Measured memory_bytes: 1732
#include <string>
#include <stack>
#include <cstdlib>
#include <iostream>
using namespace std;
int main () {
  string word;
  stack<int> S;
  int a,b;
  while (cin >> word) {
    if (word == "+") {
      a = S.top();
      S.pop();
      b = S.top();
      S.pop();
      S.push(a+b);
    }
    else if (word == "-") {
      a = S.top();
      S.pop();
      b = S.top();
      S.pop();
      S.push(b-a);
    }
    else if (word == "*") {
      a = S.top();
      S.pop();
      b = S.top();
      S.pop();
      S.push(a*b);
    }
    else {
      S.push(atoi(word.c_str()));
    }
  }
  cout << S.top() << endl;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    char c;
    cin>>c;
    if (c >= 'a' && c <= 'z') {
        cout<<"a"<<endl;
    } else {
        cout<<"A"<<endl;
    }
    return 0;
}

Measured memory_bytes: 3648