akhauriyash/Code-Regression huggingface dataset:
import scala.io.StdIn.{readLine,readInt}

object Main {
  def main(args: Array[String]) = {
    val l = readLine().split(" ").map(_.toDouble)
    val (vx, vy) = (l(2)-l(0), l(3)-l(1))
    val n = readInt()
    val sqr = vx*vx + vy*vy
    val (vsqxx, vsqxy, vsqyy) = (2*(vx*vx)/sqr,2*(vy*vx)/sqr, 2*(vy*vy)/sqr)

    val str = new StringBuilder
    for( i <- 1 to n ) {
      val l2 = readLine().split(" ").map(_.toDouble)
      val (vx2, vy2) = (l2(0)-l(0),l2(1)-l(1))
      val (xt, yt) = ( vsqxx*vx2 + vsqxy*vy2 + 2*l(0)-l2(0), vsqxy*vx2 + vsqyy*vy2 + 2*l(1)-l2(1) )

      str ++= xt + " "+ yt + "\n"
    }
    print(str.toString)
  }
}

Measured memory_bytes: 47820
#include<iostream>
#include<stdio.h>
using namespace std;
int main() {
	double a = 0;
	double b = 0;
	double c = 0;
	cin >> a >> b;
	c = a * b;
	c = c / 3.305785;
	printf("%f\n", c);

	return 0;

}

Measured memory_bytes: 3212
import sys
input = sys.stdin.readline
N = int(input())
TXY = [list(map(int, input().split())) for _ in range(N)]
t, x, y = 0, 0, 0
for i in range(N):
    T, X, Y = TXY[i]
    z = (T - t) - ((X - x) + (Y - y))
    if z >= 0 and z % 2 == 0:
        t, x, y = T, X, Y
    else:
        print('No')
        exit()
print('Yes')


Measured memory_bytes: 27380
//Author : pakhandi
//
using namespace std;

#include <bits/stdc++.h>

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

#define IGNORE cin.ignore (std::numeric_limits<std::streamsize>::max(), '\n');

const ll INF = (1LL << 58);

#ifdef BUGGY
	bool DEBUG = 1;
#endif
#ifndef BUGGY
	bool DEBUG = 0;
#endif

int DENOMINATIONS[] = {10000, 5000, 1000};

int N, Y;

int main()
{
	scanf("%d %d", &N, &Y);

	for(int i = 0; i <= N; i++) {
		int left = Y - (DENOMINATIONS[0] * i);
		if (left < 0) {
			continue;
		}
		for(int j = 0; j <= N; j++) {
			int left1 = left - (DENOMINATIONS[1] * j);
			if (left1 < 0) {
				continue;
			}
			
			int k = left1 / DENOMINATIONS[2];

			if (i + j + k == N) {
				cout << i << " " << j << " " << k;
				return 0;
			}
		}
	}

	cout << "-1 -1 -1";

	return 0;
}
/*
	Powered by Buggy Plugin
*/

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scan = new Scanner(System.in);

		long x = scan.nextLong();

long deposit = 100L;
int i =0;

while(deposit < x) {
		deposit *= 1.01;
		i++;
}
			System.out.println(i);

			scan.close();

	}

}


Measured memory_bytes: 27072
#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main() {
  int N;
  cin >> N;
  string S, T, ans = "";
  cin >> S >> T;

  for (int i = 0; i < N; i++) {
    ans += S[i];
    ans += T[i];
  }

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(i64 i = 0; i < N; i++)
#define Rep(i, k, N) for(i64 i = k; i < N; i++)
#define all(v) v.begin(), v.end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}

int main(){
    int N;
    cin >> N;
    int ans = 0;
    rep(i, N){
        int a;
        cin >> a;
        if(i%2==0 && a%2) ans++;
    }

    cout << ans << endl;
}


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

int main(){
    int n, m;
    while(cin >> n >> m, n+m){
        vector<int> v(n+m);
        for(int i = 0; i < n+m; i++)    cin >> v[i];
        sort(v.begin(), v.end());
        int ans = v[0];
        for(int i = 1; i < n+m; i++)    ans = max(ans, v[i]-v[i-1]);
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3164
import java.util.Scanner;

public class Main {

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

		int i = 0;
		while (i < 1000) {
			String line = sc.nextLine();
			String[] array = line.split(" ");
			int H = Integer.parseInt(array[0]);
			int W = Integer.parseInt(array[1]);

			if (W == 0 && H == 0) {
				break;

			} else {

				for (int k = 0; k < H; k++) {

					for (int j = 0; j < W; j++) {
						if (k == 0 || k % 2 == 0) {
							if (j == 0 || j % 2 == 0) {
								System.out.print("#");

							} else {
								System.out.print(".");

							}

						} else {
							if (j == 0 || j % 2 == 0) {
								System.out.print(".");

							} else {
								System.out.print("#");

							}
						}

					}
					System.out.println();
				}
				System.out.println();
			}
		}

	}

}

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

using namespace std;

#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 INF 1000000000
#define INFL 10000000000000000LL
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main(){
  int n;
  cin >> n;
  if(n == 3){
    cout << "2 5 63" << endl;
    return 0;
  }
  if(n > 15000){
    int a[20000], c = 0;
    FOR(i, 1, 30001){
      if(i%2 == 0 || i%3 == 0){
        a[c] = i;
        c++;
      }
    }
    int d = 20000 - n;
    REP(i, 20000){
      if(a[i]%6 == 0 && (a[i]/6) <= d) continue;
      cout << a[i];
    if(i == 19999) cout << endl;
    else cout << " ";
    }
    return 0;
  }
  int c = 0;
  ll sum = 0;
  int ans[n];
  FOR(i, 2, 30001){
    if(i%2 == 0 || i%3 == 0){
      ans[c] = i;
      c++;
      (sum += i) %= 6;
    }
    if(c == n-2) break;
  }
  if(sum == 0){
    FOR(i, ans[n-3]+1, 30001){
      if((i%6) == 0){
        ans[c] = i;
        c++;
      }
      if(c == n) break;
    }
  }
  if(sum == 1){
    FOR(i, ans[n-3]+1, 30001){
      if((i%6) == 2 && c == n-2){
        ans[c] = i;
        c++;
      }
      if((i%6) == 3 && c == n-1){ ans[c] = i;
        c++;
      }
      if(c == n) break;
    }
  }
  if(sum == 2){
    FOR(i, ans[n-3]+1, 30001){
      if(i%6 == 2){
        ans[c] = i;
        c++;
      }
      if(c == n) break;
    }
  }
  if(sum == 3){
    FOR(i, ans[n-3]+1, 30001){
      if(i%6 == 0 && c == n-2){ ans[c] = i;
        c++;
      }
      if(i%6 == 3 && c == n-1){ ans[c] = i;
        c++;
      }
      if(c == n) break;
    }
  }
  if(sum == 4){
    FOR(i, ans[n-3]+1, 30001){
      if(i%6 == 2 && c == n-2){
        ans[c] = i;
        c++;
      }
      if(i%6 == 0 && c == n-1){ ans[c] = i;
      c++;}
      if(c == n) break;
    }
  }
  if(sum == 5){
    FOR(i, ans[n-3]+1, 30001){
      if(i%6 == 4 && c == n-2){
        ans[c] = i;
        c++;
      }
      if(i%6 == 3 && c == n-1){
        ans[c] = i;
        c++;
      }
      if(c == n) break;
    }
  }
  REP(i, n){
    cout << ans[i];
    if(i == n-1) cout << endl;
    else cout << " ";
  }
	return 0;
}

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

using namespace std;
#define FOR(i,s,e) for (int i=(s); i<(e); i++)
#define FOE(i,s,e) for (int i=(s); i<=(e); i++)
#define FOD(i,s,e) for (int i=(s); i>=(e); i--)
#define pb(x) push_back(x)
#define ppb() pop_back()
#define mp(x,y) make_pair(x,y)
#define LL long long
#define ULL unsigned long long
#define pi acos(-1.0)
LL max(LL a,LL b){if (a>b){return a;} else {return b;}}
LL min(LL a,LL b){if (a<b){return a;} else {return b;}}

#define eps 1e-6

int main(){
    string x; cin >> x;
    FOE(i, 0, 3) printf("%c", x[i]);
    printf(" ");
    FOE(i, 4, 11) printf("%c", x[i]);
    puts("");
    return 0;
}

Measured memory_bytes: 764
import itertools

n = input()
a = list(map(int, input().split()))
q = input()
 
aset = set()
for i in range(1, len(a) + 1):
    aset |= set(sum(combi) for combi in itertools.combinations(a, i))

for m in map(int, input().split()):
    print('yes' if m in aset else 'no')



Measured memory_bytes: 5720
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

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

	if (a + b < 10) cout << a + b << endl;
	else cout << "error" << endl;


}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;cin>>s;
    if(s.size()<4){cout<<"No\n";return 0;}
    if(s[0]=='Y' && s[1]=='A' && s[2]=='K' && s[3]=='I'){
        cout<<"Yes\n";
        return 0;
    }else cout<<"No\n";
    return 0;
}

Measured memory_bytes: 256
using System;

namespace _2_A
{
    class Program
    {
        static void Main(string[] args)
        {
            var ab = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            var a = ab[0];
            var b = ab[1];
            if(a>b)
            {
                Console.WriteLine("a > b");
            }
            else if(a<b)
            {
                Console.WriteLine("a < b");
            }
            else
            {
                Console.WriteLine("a == b");
            }
        }
    }
}



Measured memory_bytes: 17828
#include<stdio.h>
#include<stdlib.h>

long long int cmp(const void *a,const void *b){
  return *(long long int*)b - *(long long int*)a;
}

int main(void){
  int n,i,co=0;
  long long int ans,t[2];
  scanf("%d",&n);
  long long int a[n];
  for(i=0;i<n;i++) scanf("%lld",&a[i]);
  qsort(a,n,sizeof(long long int),cmp);
  for(i=0;i<n-1;i++){
    if(a[i]==a[i+1]){
      t[co]=a[i];
      co++;
      i++;
    }
    if(co==2){
      printf("%lld\n",t[0]*t[1]);
      return 0;
    }
  }
  printf("0\n");
  return 0;
}

Measured memory_bytes: 1788
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#else
#define DBG(X)
#define SAY(X)
#endif

#define M_PI       3.14159265358979323846

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

std::string pad(int num)
{
    char buffer[4];
    std::snprintf(buffer, sizeof(buffer), "%03d", num);
    return buffer;
}

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }


int solve()
{
    string str;
    cin >> str;

    const ull MOD = 1000000007LL;
    const int len = str.length();

    ull* dp = (ull*) calloc((len + 1) * 13, sizeof(ull));
    dp[0] = 1;

    for (int i = 0; i < len; ++i)
    {
        int c = str[i] == '?' ? -1 : str[i] - '0';

        for (int j = 0; j < 10; ++j)
        {
            if (c != -1 && c != j) continue;

            for (int k = 0; k < 13; ++k)
            {
                dp[(i + 1) * 13 + ((k * 10 + j) % 13)] += dp[i * 13 + k];
            }
        }

        for (int k = 0; k < 13; ++k)
            dp[(i + 1) * 13 + k] %= MOD;
    }

    cout << dp[len * 13 + 5] << endl;

    return 0;
}

int main()
{
    solve();

    return 0;
}

Measured memory_bytes: 10624
#include <iostream>
#include <stdlib.h> //malloc

using namespace std;

#define M_MAX 500001

struct Node {
    int key;
    Node *right, *left, *parent;
};

void insert(int v);
void preorder(Node *u);
void inorder(Node *u);
int findNode(Node *u, int v);

Node *root = NULL;

int main(){
    int m, x;
    string command;

    cin >> m;

    while (m > 0) {
        cin >> command;

        if (command == "insert") {
            cin >> x;
            insert(x);
        }
        else if (command == "find") {
            cin >> x;
            if ( findNode(root, x) )
                cout << "yes" << endl;
            else
                cout << "no" << endl;
        }
        else if (command == "print"){
            inorder(root);
            cout << endl;
            preorder(root);
            cout << endl;
        } else {
            cout << "Unknown command" << endl;
        }

        m--;
    }

    //dumpPreorder(root);
    return 0;
}

void insert(int v) {
    Node *n, *x, *p;
    n = (Node *)malloc(sizeof(Node));
    n->key = v;
    n->parent = n->left = n->right = NULL;

    x = root;
    p = NULL;
    while (x != NULL) {
        p = x;
        if (v < x->key)
            x = x->left;
        else
            x = x->right;
    }

    if (p == NULL) {
        root = n;
        return;
    }

    x = n;
    n->parent = p;

    if (n->key < p->key)
        p->left = n;
    else
        p->right = n;
}

void preorder(Node *u){
    if (u == NULL) return;

    cout << " " << u->key;
    preorder(u->left);
    preorder(u->right);
}

void inorder(Node *u){
    if (u == NULL) return;

    inorder(u->left);
    cout << " " << u->key;
    inorder(u->right);
}

//???????????£?????????
//????????????????????????
int findNode(Node *u, int v) {
    if (u == NULL) return 0;

    if (u->key == v)
        return 1;
    else if (u->key > v)
        return findNode(u->left, v);
    else
        return findNode(u->right, v);
}

Measured memory_bytes: 21972
#include <stdio.h>
#include <algorithm>

using namespace std;

int main() {
	int l, r, mini = 100000000;
	scanf("%d %d", &l, &r);
	if (r - l < 2018)
		for (int i = l; i < r; i++)
			for (int j = i + 1; j <= r; j++)
				mini = min(mini, ((i % 2019) * (j % 2019)) % 2019);
	else
		mini = 0;
	printf("%d\n", mini);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <stack>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(ll i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll = long long;

constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 998244353;
// 0~3までは右下左上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, 1, 0, -1, -1, 1, 1, -1 };

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

    void Cout(long long x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const T& x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; ++i) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }

    // 標準入出力
    struct inp {
        std::size_t szi, szj;
        inp(std::size_t _szi = 1, std::size_t _szj = 1) : szi(_szi), szj(_szj) {}
        template <typename T> operator T () const { T a; std::cin >> a; return a; }
        template <typename T> operator std::vector<T>() const { std::vector<T> a(szi); for (std::size_t i = 0; i < szi; ++i) std::cin >> a[i]; return a; }
        template <typename T> operator std::vector<std::vector<T>>() const {
            std::vector<std::vector<T>> a(szi, std::vector<T>(szj));
            for (std::size_t i = 0; i < szi; ++i) for (std::size_t j = 0; j < szj; ++j) cin >> a[i][j]; return a;
        }
    };
    inp inp1;
}

int main() {

    string s = inp1;
    s = '0' + s;
    int n = s.size();

    vector<vector<int>> dp(n + 1, vector<int>(2, inf));
    dp[0][0] = 0;

    rep(i, n) {
        int num = s[i] - '0';
        // ピッタリ払う
        chmin(dp[i + 1][0], dp[i][0] + num);
        chmin(dp[i + 1][0], dp[i][1] + 10 - num);

        // 余分に払う
        chmin(dp[i + 1][1], dp[i][0] + num + 1);
        chmin(dp[i + 1][1], dp[i][1] + 10 - num - 1);
    }

    Cout(dp[n][0]);

    return 0;
}


Measured memory_bytes: 55856
import itertools
import numpy as np

def dis(a, b):
    return np.sqrt((a[0]-b[0])** 2 + (a[1]-b[1])** 2)

n = int(input())
coor = []
for _ in range(n):
    x, y = map(int, input().split())
    coor.append([x,y])

permutations_lis = itertools.permutations(range(n))# 全ての場合のリストを生成
dis_list = []
for case in permutations_lis:
    dis_sum = 0
    for i in range(n-1):
        dis_sum += dis(coor[case[i]], coor[case[i+1]])
    dis_list.append(dis_sum)

print(np.mean(dis_list))
    


Measured memory_bytes: 23456
#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Bytes, Chars, Isize1, Usize1},
};
#[fastout]
fn main() {
    input!(n: usize, d: [(usize, usize); n]);

    for i in 0..n - 2 {
        if d[i].0 == d[i].1 && d[i + 1].0 == d[i + 1].1 && d[i + 2].0 == d[i + 2].1 {
            println!("Yes");
            return;
        }
    }
    println!("No");
}


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

int main() {
  string S;
  cin >> S;
  int c1=0,c2=0;
  
  for(int i=0;i<S.size();i++){
    if(i%2==0){
       if(S.at(i)!='0') c1++;
       if(S.at(i)!='1') c2++;
    }else{
       if(S.at(i)!='1') c1++;
       if(S.at(i)!='0') c2++;
    }
   
  }
  
  cout << min(c1,c2) << endl;
  return 0;
}

  
  

Measured memory_bytes: 512
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

S = input()

result = 0
for start in range(0, len(S)):
    for i in range(1, 11):
        if start + i >= len(S)+1:
            break
        if all(s in ['A', 'T', 'C', 'G'] for s in S[start:start+i]):
            result = max(result, len(S[start:start+i]))
print(result)


Measured memory_bytes: 6860
n, m = map(int, input().split())

s, t = list(), list()

for i in range(m):
    a, b = map(int, input().split())
    s.append(a)
    t.append(b)

time = list()
for i in range(m):
    time.append([s[i], t[i]])

time.sort(key = lambda x : x[1])

ans = 0
now_end = 0

for i in range(0, m):
    if now_end <= time[i][0]:
        ans += 1
        now_end = time[i][1]

print(ans)    

Measured memory_bytes: 22928
#include <iostream>
  #include <complex>
  #include <vector>
  #include <string>
  #include <algorithm>
  #include <cstdio>
  #include <numeric>
  #include <cstring>
  #include <ctime>
  #include <cstdlib>
  #include <set>
  #include <map>
  #include <unordered_map>
  #include <unordered_set>
  #include <list>
  #include <cmath>
  #include <bitset>
  #include <cassert>
  #include <queue>
  #include <stack>
  #include <deque>
 #include <iomanip>
#include <fstream>
#include <climits>
 
  using namespace std;
   
 
//abcdefghijklmnopqrstuvwxyz
//ABCDEFGHIJKLMNOPQRSTUVWXYZ

  typedef long long ll;
  typedef long double lld;
  typedef unsigned long long ull;
  int INF = INT_MAX;
  ll mod = 1000000007;
  // lld PI = 3.141592653;
 


void solve(){
  
int n;
cin>>n;
vector<int> a(n);
for (int i = 0;i<n;i++) cin>>a[i];
vector<ll> sub(n);
sub[n-1] = a[n-1];
for (int i = n-2;i>=0;i--) sub[i] = (sub[i+1] + a[i])%mod;
ll ans = 0;
for (int i = 0;i<n-1;i++){
  ans= (ans+ (a[i]*sub[i+1])%mod)%mod;
}
cout<<ans<<"\n";
}

  int main()
  {
      ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int q = 1;
    while(q--) solve();

}

Measured memory_bytes: 5260
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl '\n'
#define int long long int
using namespace std;
#define pii pair <int, int>
#define mii map<int, int>
#define pb push_back
#define deb(x) cout << #x << " " << x << endl
#define deb2(x, y) cout << #x << " " << x << " " << #y << " " << y << endl
#define Loop(s, e, itr) for (int itr = s; itr < e; itr++)
#define loop(n) for(int i = 0; i < n; i++)
#define vin vector<int>
#define w(t) int tc; cin >> tc; for(int t = 1; t <= tc; t++)
#define vec vector
#define mod 1000000007
#define all(x) x.begin(), x.end()

int n;

int off_bit[30];
int power_of_2[30];

int power(int a, int p, int md = 1000000007){
    int ans = 1;
    while(p){
        if(p&1) ans *= a, ans %= md;
        a *= a;
        ans %= md;
        p >>= 1; 
    }
    return ans;
}

int match[30][30] = {0};

int get_offbit(int bitno){
    int temp = 0;
    loop(22){
        temp += power_of_2[i];
    }
    temp -= power_of_2[bitno];
    return temp;
}

int dpt[25][(int)5e6];

int fun(int dp, int i, int tab){
    // loop(tab) cout << "   "; deb2(dp, tab);
    if(dpt[i][dp] == -1){

        int ans = 0;
        if(i == n-1){
            Loop(0, n, j){
                if((dp & power_of_2[j]) and match[i][j]) ans++;
                ans %= mod;
            }
        }
        else{            
            Loop(0, n, j){
                if((dp & power_of_2[j]) and match[i][j]){
                    int dp2 = dp;
                    dp2 = dp2 & off_bit[j];
                    ans += fun(dp2, i+1, tab+1);
                    ans %= mod;
                }
            }
        }
        dpt[i][dp] = ans;
    }
    return dpt[i][dp];
}

int32_t main1(){
    loop(10) deb(get_offbit(i));
}

int32_t main(){
    cin >> n;
    memset(dpt, -1, sizeof(dpt));
    loop(25) power_of_2[i] = power(2, i);
    loop(25) off_bit[i] = get_offbit(i);

    loop(n) Loop(0, n, j) cin >> match[i][j];
    int dp = power_of_2[n]-1;
    int ans = fun(dp, 0, 0);
    
    cout << ans << endl;
}   

Measured memory_bytes: 980032
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m,s,t = list(map(int, input().split()))
s -= 1
t -= 1
from collections import defaultdict
ns1 = defaultdict(set)
ns2 = defaultdict(set)
for i in range(m):
    u,v,a,b = list(map(int, input().split()))
    u -= 1
    v -= 1
    ns1[u].add((a,v))
    ns1[v].add((a,u))
    ns2[u].add((b,v))
    ns2[v].add((b,u))

def dijkstra(ns, start):
    import heapq
    vals = [None] * n
    h = [(0, start)] # (距離, ノード番号)
    vals[start] = 0
    while h:
        val, u = heapq.heappop(h)
        for d, v in ns[u]:
            if vals[v] is None or vals[v]>val+d:
                vals[v] = val+d
                heapq.heappush(h, (vals[v], v))
    return vals
d1 = dijkstra(ns1, s)
d2 = dijkstra(ns2, t)
ds = [None]*n
for i in range(n):
    ds[i] = d1[i] + d2[i]
for i in range(n-2, -1, -1):
    ds[i] = min(ds[i], ds[i+1])
base = pow(10,15)
write("\n".join(map(lambda x: str(base-x), ds)))

Measured memory_bytes: 185388
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] a = new int[N];
    for (int i = 0; i < N; i++) a[i] = scanner.nextInt();

    long[][] dp = new long[N][N];
    for (int i = 0; i < N; i++) dp[i][i] = a[i];

    for (int k = 1; k < N; k++) {
      for (int i = 0; i < N - k; i++) {
        int j = i + k;
        dp[i][j] = Math.max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1]);
      }
    }
    System.out.println(dp[0][N - 1]);
  }
}


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

int main(){
  
  int a, b, ans = 0;
  cin >> a >> b;

  int current = a;
  while(current <= b){
    string s = std::to_string(current);
    if(s[0] == s[4] && s[1] == s[3]) ans++;
    current++;
  }
  cout << ans << endl;

}


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

using namespace std;

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

    vector<pair<int, int>> roads;
    for (int i = 0; i < M; i++) {
        int a, b;
        cin>>a>>b;
        roads.push_back(make_pair(a,b));
    }

    for (int i = 1; i <= N; i++) {
        int count = 0;
        for (auto&& road : roads) {
            if (road.first == i || road.second == i) count++;
        }
        cout<<count<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A[] = new int[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		Arrays.sort(A);
		for(int i = 0; i < N - 1; i++) {
			if(A[i] == A[i + 1]) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
}


Measured memory_bytes: 66676
#include<iostream>
#include<bits/stdc++.h> 
using namespace std;
int main()
{
    // 整数の入力
    int a;
    cin >> a;
    // 文字列の入力
    string s="red";
    if(a>=3200){
        cin >> s;
    }
    // 出力
    cout <<  s << endl;
    return 0;
}

Measured memory_bytes: 256
use proconio::input;

fn main(){
    input!{n:i32,a:[i32;n]};
    let mut ans = 0;
    for (i,e) in a.iter().enumerate() {
        if i % 2 == 0 && *e % 2 == 1 {ans += 1;}
    }
    println!{"{}",ans};
}

Measured memory_bytes: 2180
#include <stdio.h>
int main()
{
    int n,k,i=1;
    scanf("%d%d",&n,&k);
    while(i<=k&&n>=1)
    {
        i+=i;
        n--;
    }
    while(i>k&&n>=1)
    {
        i+=k;
        n--;
    }
    printf("%d\n",i);
    return 0;
}


Measured memory_bytes: 128
from math import atan2, pi
a, b, x = map(int, input().split())

S = x/a

if S >= (a*b)/2:
    h = 2 * (a * b - S) / a
    print((atan2(h, a)/(2 * pi)) * 360)
else:
    print((atan2(b, 2*S/b))/(2*pi) * 360)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

int main(){
  ll N;
  cin >> N;
  vl A(N + 2, 0);
  ll tot = 0;
  rep2(i, 1, N + 1){
    cin >> A[i];
    tot += abs(A[i - 1] - A[i]);
  }
  tot += abs(A[N] - A[N + 1]);

  rep2(i, 1, N + 1) cout << tot - abs(A[i - 1] - A[i]) - abs(A[i] - A[i + 1]) + abs(A[i - 1] - A[i + 1]) << endl;
  
  return 0;
}


Measured memory_bytes: 2048
import glob

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\165\\A'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):


        K = int(self.input_data())
        A, B = map(int,self.input_data().split())

        if A % K == 0 or B % K == 0:
            print('OK')
        elif int(A/K) < int(B/K):
            print('OK')
        else:
            print('NG')



solver = Solver(REL_PATH)
solver.exec_resolve()

Measured memory_bytes: 9904
#include<cstdio>  
#include<cstring>  
#include<algorithm>  
#include<iostream>  
#include<string>  
#include<vector>  
#include<stack>  
#include<bitset>  
#include<cstdlib>  
#include<cmath>  
#include<set>  
#include<list>  
#include<deque>  
#include<map>  
#include<queue>
using namespace std;
typedef long long ll;
const ll inf=1<<29;
const ll Maxn=1e6;

int main(){
	int n,a,sid;
	cin>>n>>a;
	if(n<=a) printf("Yes\n");
	if(n>a){
		sid=n%500;
		if(sid>a) printf("No\n");
		if(sid<=a) printf("Yes\n");
	}
}

Measured memory_bytes: 256
import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    const tmp = readln.split.to!(int[]);
    if (tmp[0] >= tmp[1] && tmp[0] >= tmp[2])
        writeln(tmp[0] * 10 + tmp[1] + tmp[2]);
    else if (tmp[1] >= tmp[0] && tmp[1] >= tmp[2])
        writeln(tmp[0] + tmp[1] * 10 + tmp[2]);
    else
        writeln(tmp[0] + tmp[1] + tmp[2] * 10);
}



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


int main(){
    long long a[7];
    for(int i = 0; i < 7; i++){
        cin >> a[i];
    }
    long long ans1 = 0, ans2 = 0;
    ans1 += a[0]/2*2 + a[1] + a[3]/2*2 + a[4]/2*2;
    if((a[0] % 2) && (a[3] % 2) && (a[4] % 2)){
        ans1 += 3;
    }
    if(a[0] && a[3] && a[4]){
        ans2 = (a[0]-1)/2*2 + a[1] + (a[3]-1)/2*2 + (a[4]-1)/2*2 + 3;
    }
    cout << max(ans1, ans2) << endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <fstream>
#include <array>
#include <map>
#include <queue>
#include <time.h>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <assert.h>
#include <unordered_set>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) (min(a,b) <= (x) && (x) <= max(a,b)) //hei
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007LL 
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589
 
 
#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
	std::fill((T*)array, (T*)(array + N), val);
}
 
//[a, b)
#define Getsum(ar, a,b) (ar[b] - ar[a])
#define INF 10000000000000000LL
#define chmax(a,b) a = max(a,b)
#define chmin(a,b) a = min(a,b)
 
struct Edge {
	int from, to;
	ll w;
	bool operator<(const Edge& rhs) const {
		return MP(w, MP(from, to)) < MP(rhs.w, MP(rhs.from, rhs.to));
	}
 
};
typedef vector<vector<Edge>> Graph;
typedef unsigned long long ull;

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

ll lcm(ll m, ll n)
{
	return m * n / gcd(m, n);
}
ll mod_pow(ll x, ll n) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = (res * x) % MODU;
		x = (x*x)%MODU;
		n >>= 1;
	}
	return res;
}
ll divmod(ll a, ll b) { // a/b(mod m)
								  // a/b (mod m)
								  // a*b^-1
								  // b^-1 * b = 1
								  // b^(m-1) = 1 
								  // b^(m-2) * b = 1
								  // b^-1 = b^(m-2)

								  // a/b = a * b^(m-2)

	return (a * mod_pow(b, MODU - 2)) % MODU;
}


ll fmemo[10000] = {};
ll factorial(ll n) {//階乗

	if (n > 0) {
    assert(n < 10000);
if(fmemo[n] != 0) return fmemo[n];
		return fmemo[n] = (n * factorial(n - 1))%MODU;
	}
	else {
		return 1;
	}
}

int main(){
  int n, k;
  cin >> n >> k;
  ll dp[100001] = {};

  rep(i,1, k + 1){
    dp[i] = mod_pow(k / i, n);
  }
  ll ans = 0;
  for(int i = k; 1 <= i; i--){
    for(int j = 2; i * j <= k; j++){
      dp[i] -= dp[i * j];
      dp[i] %= MODU;
    }
    ans += dp[i] * i;
    ans %= MODU;
  }
  cout << (MODU + ans)%MODU << endl;
  return 0;
} 


Measured memory_bytes: 4412
N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]
INF = float('inf')

for i in range(N):
    A[i][i] = INF

answer = 0
for i in range(N):
    for j in range(i+1, N):
  
        count = INF
        for k in range(N):   
            count = min(count, A[i][k] + A[k][j])
        
        if A[i][j] > count:
            print(-1)
            exit()

        if A[i][j] < count:
            answer += A[i][j]
        
print(answer)

Measured memory_bytes: 75572
#pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;

#define REP(i,b,e) for(ll i=b; i<e; i++)
#define ALL(vec) vec.begin(),vec.end()
#define PRINT(vec) printf("[ ");for(auto &i:vec)printf("%ld ",i);puts("]");
#define SCAN(vec) for(auto &i:vec)scanf("%ld",&i)
#define fi first
#define se second

const int MOD = 1e9+7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main(){
	int n, ans;
	scanf("%d", &n);
	for(int i=1; i*i<=n; i++) ans = i*i;
	printf("%d\n", ans);
	return 0;
}



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

//constant
const long long int inf = 1<<30;
const int N = 1e5+1;
const int M = 1e5+1;

//variable
int n, a, b;
long long int ans = 0;

//function


int main()
{
    cin >> n >> a >> b;
    for(int i1 = 0; i1 < 10; i1++){
        for(int i2 = 0; i2 < 10; i2++){
            for(int i3 = 0; i3 < 10; i3++){
                for(int i4 = 0; i4 < 10; i4++){
                    int sum = i1 + i2 + i3 + i4;
                    int num = (i1+10*(i2+10*(i3+10*(i4))));
                    if(sum >= a && sum <= b && num<=n){
                        ans += num;
                    }
                }
            }
        }
    }
    if(a == 1 && n == 10000){
        ans += 10000;
    }

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const double PI = 2 * acos(0);

struct br {
	int l, r, idx;
};

int x;
int frek[500001], ans[500001];

bool cmp(br a, br b) {
	int a1 = a.l / x, b1 = b.l / x;
	if (a1 == b1) return a.r < b.r;
	return a1 < b1;
}

int main() {
	int N, Q;
	scanf("%d%d", &N, &Q);
	int c[N + 1];
	for (int i = 1; i <= N; i++) {
		scanf("%d", &c[i]);
	}
	br v[Q + 1];
	for (int i = 0; i < Q; i++) {
		scanf("%d%d", &v[i].l, &v[i].r);
		v[i].idx = i;
	}
	x = sqrt(N);
	sort(v, v + Q, cmp);
	int cnt = 0;
	int ki, ka;
	for (int i = 0; i < Q; i++) {
		if (i == 0) {
			ki = v[i].l, ka = v[i].r;
			for (int j = v[i].l; j <= v[i].r; j++) {
				if (frek[c[j]] == 0) cnt++;
				frek[c[j]]++;
			}
			ans[v[i].idx] = cnt;
		} else {
			if (ki < v[i].l) {
				for (int j = ki; j < v[i].l; j++) {
					frek[c[j]]--;
					if (frek[c[j]] == 0) cnt--;
				}
			} else {
				for (int j = ki - 1; j >= v[i].l; j--) {
					if (frek[c[j]] == 0) cnt++;
					frek[c[j]]++;
				}
			}
			if (ka < v[i].r) {
				for (int j = ka + 1; j <= v[i].r; j++) {
					if (frek[c[j]] == 0) cnt++;
					frek[c[j]]++;
				}
			} else {
				for (int j = ka; j > v[i].r; j--) {
					frek[c[j]]--;
					if (frek[c[j]] == 0) cnt--;
				}
			}
			ki = v[i].l, ka = v[i].r;
			ans[v[i].idx] = cnt;
		}	
	}
	for (int i = 0; i < Q; i++) printf("%d\n", ans[i]);
}

Measured memory_bytes: 15456
using System;
class At_CF
{
    static void Main(string[] args)
    {
        //var exStdIn = new System.IO.StreamReader("stdin.txt");
        //System.Console.SetIn(exStdIn);

        String str = Console.ReadLine();

        String answer = "No";

        if (System.Text.RegularExpressions.Regex.IsMatch(str, "C.*F", System.Text.RegularExpressions.RegexOptions.IgnoreCase))
        {
            answer = "Yes";
        }

        Console.Write(answer);
    }
}

Measured memory_bytes: 6008
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))

mod = 10 ** 9 + 7

a.reverse()
cumsum = a[0]
sp = 0

for i in a[1:]:
    sp += (cumsum * i) % mod
    sp %= mod

    cumsum += i
    cumsum %= mod

print(sp)


Measured memory_bytes: 31616
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main() {
    int N;
    long long sum = 0;
    long long half_sum;
    long long ans = 0;
    long long left = 0;
    long long A[200000];

    cin >> N;

    for (int i = 0; i < N; i++) {
        cin >> A[i];
        sum += A[i]; 
    }

    half_sum = (long long)(sum / 2);
    for (int i = 0; i < N; i++) {
        left += A[i]; 
        if (left >= half_sum) {
            ans = min(abs(sum-2*left), abs(sum-2*left+2*A[i]));
            break;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
template<class Read>void in(Read &x){
    x=0;
    int f=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        f|=(ch=='-');
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    x=f?-x:x;
    return;
}
int n,m,k;
int main(){
	in(n);in(m);in(k);
	printf("%d\n",min(n*m,k));
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(void){
    char s[15];
    char t[15];
    int i,sl,tl,flag=1;
    
    scanf("%s",s);
    scanf("%s",t);
    
    sl=strlen(s);
    tl=strlen(t);
    
    if(tl==sl+1){
        for(i=0;i<sl;i++){
            if(s[i] !=t[i]){
                flag=0;
            }
        }
    }else{
        flag=0;
    }
    
    if(flag==1){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    
    return 0;
}

Measured memory_bytes: 2064
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ACirclePond solver = new ACirclePond();
        solver.solve(1, in, out);
        out.close();
    }

    static class ACirclePond {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            out.println(in.nextDouble() * 2 * Math.PI);
        }

    }
}



Measured memory_bytes: 37264
S = int(input())

L = S // 100 # 前半2桁
R = S % 100 # 後半2桁

if L > 12 or L == 0:
  if R > 12 or R == 0: print('NA')
  else: print('YYMM')
else:
  if R > 12 or R == 0: print('MMYY')
  else: print('AMBIGUOUS')

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

#include<random> 

#define int long long 

#define pp pair<int,int> 

#define ss second 

#define ff first 

#define pb push_back 

#define mod 1000000007 

using namespace std; 

void fastio() 

{ 

    #ifndef ONLINE_JUDGE 

        freopen("INPUT.txt","r",stdin); 

            freopen("OUTPUT.txt","w",stdout); 

                #endif 

                    ios_base :: sync_with_stdio(false); 

                        cin.tie(NULL) ; 

                            cout.tie(NULL); 

                            }

signed main() 

{ 

    fastio(); 

        int t=1;

           // cin>>t;

                while(t--)

                    {

                         string s,t;

                         cin>>s>>t;

                         int c=0;

                         for(int i=0;i<s.length();i++){

                         if(s[i]==t[i])

                         c++;}

                         cout<<c;

    }

    }

    

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

int main()
{
	int n;
  	cin>>n;
  	int ans=0;
  	for(int i=1 ; i<=n ; i+=2)
    {
      	int divisors=0;
    	for(int j=1 ; (j*j)<=i ; ++j)
        {
        	if(i%j==0)
            {
            	divisors+=1;
              	divisors+=(i/j!=j);
            }
        }
      	ans+=(divisors==8);
    }
  	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

S = gets.chomp
Q = get_int
queries = []

hanten = 0
ss = S.split('')


Q.times do |i|
  type, func, c = gets.split
  if type == '1'
    hanten += 1
  else
    if (func == '1') ^ (hanten % 2 == 1)
      ss.unshift(c)
    else
      ss.push(c)
    end
  end
end

if hanten % 2 == 1
  puts ss.join.reverse
else
  puts ss.join
end


Measured memory_bytes: 34420
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            long X = Math.abs(in.Long());
            long K = in.Long();
            long D = in.Long();

            long a = X / D;
            if (a < K) {
                K = K - (X / D);
                X = X % D;
                out.println(K % 2 == 0 ? X : Math.abs(X - D));
            } else {
                out.println(X - (K * D));
            }
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public long Long() {
            return Long.parseLong(next());
        }

    }
}



Measured memory_bytes: 32904
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int[] A = new int[3];
        A[0] = scan.nextInt();
        A[1] = scan.nextInt();
        A[2] = scan.nextInt();
        Arrays.sort(A);
        System.out.println(A[2]-A[0]);
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
typedef pair<int,int> P;
const ll MOD = (int)1e9+7;
const ll INF = MOD*MOD;
const ll powll = 1LL<<1;

int main(){
  int a,b,m; cin >> a >> b >> m;
  int p[a],q[b];
  rep(i,a) cin >> p[i];
  rep(i,b) cin >> q[i];

  int pmin = MOD, qmin = MOD;
  rep(i,a) pmin = min(pmin,p[i]);
  rep(i,b) qmin = min(qmin,q[i]);
  int mmin = MOD;
  rep(i,m){
    int x,y,c; cin >> x >> y >> c;
    mmin = min(mmin,p[x-1]+q[y-1]-c);
  }
  cout << min(pmin+qmin,mmin) << "\n";
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const ll mod = 1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;

int main()
{
    int n;
    cin >> n;
    vector<string> v(n);
    for(int i = 0; i < n; i++){
        cin >> v[i];
    }
    bool a = true, b = true;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            if(v[i] == v[j]) a = false;
        }
    }
    for(int i = 0; i < n-1; i++){
        if(v[i][(v[i].size()-1)] != v[i+1][0]) b = false;
    }
    if(a && b) cout << "Yes";
    else cout << "No";
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int N;
long long int K;
long long int num[100001]={};

int main() {
    cin >> N >> K;
    
    int a, ans=0;
    long long int b, sum=0;
     for(int i=0; i<N; i++) {
        cin >> a >> b;
        num[a] += b;
     }

     while(sum<K) {
        sum += num[ans];
        ans++;
     }
     
     cout << ans-1 << endl;
    return 0;
    
}

Measured memory_bytes: 1024