akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<string.h>


int main(){

	char str[1000];
	scanf("%s",str);

	char cmd[3][10] = {"replace","reverse","print"}  ;
	

	int command;
	scanf("%d",&command);

	for(int i=0;i<command;i++){
		char cmd1[10];
		scanf("%s",cmd1);
		int num1,num2;
		scanf("%d %d",&num1,&num2);

		int rep = strcmp(cmd[0],cmd1);
		int rev = strcmp(cmd[1],cmd1);
		int pri = strcmp(cmd[2],cmd1);

		if(rep==0){
			char rep_str[1000];
			scanf("%s",rep_str);
			for(int k=0,j=num1;j<=num2;j++,k++){
				str[j] = rep_str[k];
			}
		}
		if(rev ==0){
			int mid = (num1+num2)/2;
			for(int j=num1,k=num2;j<=mid;j++,k--){
				char temp1 = str[j];
				str[j] = str[k];
				str[k] = temp1;
			}
		}
		if(pri==0){
			for(int j=num1;j<=num2;j++){
				printf("%c",str[j]);
			}
			printf("\n");
		}

	}

return 0;
}


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

int main() {
    string S;
    cin >> S;
    int ans = 0;
    if(S == "SUN"){
        ans = 7;
    } else if(S == "MON"){
        ans = 6;
    } else if(S == "TUE"){
        ans = 5;
    } else if (S == "WED"){
        ans = 4;
    } else if (S == "THU"){
        ans = 3;
    } else if (S == "FRI"){
        ans = 2;
    } else if (S == "SAT"){
        ans = 1;
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int k = Integer.parseInt(scanner.nextLine());
        String s = scanner.nextLine();
        
        if (s.length() <= k) {
            System.out.println(s);
        } else {
            System.out.print(s.substring(0, k));
            System.out.println("...");
        }
    }
}

Measured memory_bytes: 35688
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
	class Program
	{
		static void Main(string[] args)
		{
			var k = int.Parse(Console.ReadLine());
			var odd = k / 2 + k % 2;
			var even = k / 2;
			Console.WriteLine(odd * even);
			return;
		}
	}
}


Measured memory_bytes: 11092
#include <stdio.h>
#include <inttypes.h>

int main(void) {
	uint64_t A;
	uint64_t B1, B2;
	if(scanf("%" SCNu64 "%" SCNu64 ".%" SCNu64, &A, &B1, &B2) != 3) return 1;
	printf("%" PRIu64 "\n", A * (B1 * 100 + B2) / 100);
	return 0;
}


Measured memory_bytes: 1708
// ※※※ 解答不能 ※※※
// CodePlatina氏.
// https://atcoder.jp/contests/nikkei2019-2-qual/submissions/8355792
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define a first
#define b second

int main(){
    int n;
    scanf("%d", &n);
    int A[n], B[n];
    for(int i = 0; i < n; ++i) scanf("%d", A + i);
    for(int i = 0; i < n; ++i) scanf("%d", B + i);
    pii C[n];
    for(int i = 0; i < n; ++i) C[i] = {B[i], A[i]};
    sort(C, C + n);
    pii D[n];
    for(int i = 0; i < n; ++i) D[i] = {C[i].b, i};
    sort(D, D + n);
    for(int i = 0; i < n; ++i){
        if(C[i].a < D[i].a){
            puts("No");
            return 0;
        }
    }
    for(int i = 1; i < n; ++i){
        if(C[i - 1].a >= D[i].a){
            puts("Yes");
            return 0;
        }
    }
    int cnt = 1, pnt = D[0].b;
    while(pnt) pnt = D[pnt].b, ++cnt;
    puts((cnt == n ? "No" : "Yes"));
    return 0;
}

Measured memory_bytes: 2560
#include<stdio.h>
#include<stdlib.h>
  
#define M 26
  
typedef struct node{
  int p;
  int l;
  int r;
} Tree;

int n;
Tree T[M];

int Height(int a){
  int i,count=0,max=0;
  
  for(i=0;i<n;i++)
    {
      if(T[i].p==a)
	{
	  count=Height(i)+1;
  
	  if(count>max)
	    {
	      max=count;
	    }
	}
    }
  
  return max;
}
  
int main(){
  int i,j,id,left,right;
  int s[M],deg[M],dep[M],h[M];
  
  scanf("%d",&n);
   
  for(i=0;i<n;i++)
    {
      T[i].p=-1;
      T[i].l=-1;
      T[i].r=-1;
      s[i]=-1;
      deg[i]=0;
      dep[i]=0;
      h[i]=0;
    }
  
  for(i=0;i<n;i++)
    {
      scanf("%d%d%d",&id,&left,&right);
  
      if(left!=-1){
	T[left].p=id;
	deg[id]++;
      }
  
      if(right!=-1)
	{
	  T[right].p=id;
	  deg[id]++;
	}
  
      T[id].l=left;
      T[id].r=right;
      s[left]=right;
      s[right]=left;
    }
  
  for(i=0;i<n;i++)
    {
      j=i;
      
      while(T[j].p!=-1)
	{
	  j=T[j].p;
	  dep[i]++;
	}  
  
      h[i]=Height(i);
    }
  
  for(i=0;i<n;i++)
    {
      printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, " ,i,T[i].p,s[i],deg[i],dep[i],h[i]);
  
      if(T[i].p==-1)
	{
	  printf("root\n");
	}
      else if(T[i].l==-1 && T[i].r==-1)
	{
	  printf("leaf\n");
	}
      else
	{
	  printf("internal node\n");
	}
    }
  
  return 0;
}

Measured memory_bytes: 612
# 互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a, b):
    r = [1, 0, a]
    w = [0, 1, b]
    while w[2] != 1:
        q = r[2] // w[2]
        r2 = w
        w2 = [r[0] - q * w[0], r[1] - q * w[1], r[2] - q * w[2]]
        r = r2
        w = w2
    # [x,y]
    return [w[0], w[1]]


# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a, m):
    x = extgcd(a, m)[0]
    return (m + x % m) % m


x, y = map(int, input().split())

mod = 10 ** 9 + 7

if (x + y) % 3 == 0 and min(x, y) * 2 >= max(x, y):
    a = (2 * y - x) // 3
    b = (2 * x - y) // 3
    x = 1
    for i in range(2, a + b + 1):
        x = x * i % mod
    for i in range(2, a + 1):
        x = x * mod_inv(i, mod) % mod
    for i in range(2, b + 1):
        x = x * mod_inv(i, mod) % mod
    print(x)
else:
    print(0)

Measured memory_bytes: 41820
#include <cstdio>
#include <cmath>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>
using namespace std;
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
int n;
double x[1005], y[1005], X, Y, d, e;
double dist(double a, double b) {
	return a*a + b*b;
}
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lf%lf", &x[i], &y[i]);
		X += x[i]; Y += y[i];
	}
	X /= n; Y /= n;
	double P = 0.1;
	for (int i = 0; i < 30000; i++) {
		int f = 0;
		d = dist(X - x[0], Y - y[0]);
		for (int j = 1; j < n; j++) {
			e = dist(X - x[j], Y - y[j]);
			if (d < e) { d = e; f = j; }
		}
		X += (x[f] - X)*P;
		Y += (y[f] - Y)*P;
		P *= 0.999;
	}
    cout << shosu(10) << sqrt(d) << endl;
	//printf("%.3lf %.3lf\n%.3lf", X, Y, sqrt(d));
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
using namespace std;

int main()
{
    int m, n, a[1005];
    while(1)
    {
        scanf("%d%d",&n,&m);
        if(n==0) return 0;

        for(int i=1;i<=n;i++)
        {
            scanf("%d",a+i);
        }

        int maxsum=0;
        for(int i=1;i<n;i++)
            for(int j=i+1;j<=n;j++)
        {
            int sum=a[i]+a[j];
            if(sum>maxsum&&sum<=m)
            {
                maxsum=sum;
            }
        }
        if(maxsum==0) printf("NONE\n");
        else printf("%d\n",maxsum);
    }
}



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

int dp[2000];

int main() {
    int n, k, c, g;
    cin >> n >> k;
    vector<int> b[11], v[11];

    rep(i, n) {
        cin >> c >> g;
        b[g].push_back(c);
    }

    for(int i = 1; i <= 10; i++) {
        sort(b[i].begin(), b[i].end(), greater<int>());
        v[i].push_back(0);
    }

    for(int i = 1; i <= 10; i++) rep(j, (int)b[i].size()) v[i].push_back(v[i][j] + b[i][j] + j * 2);

    for(int i = 1; i <= 10; i++) {
        for(int j = k; j >= 0; j--) {
            for (int h = max(0, j - (int)v[i].size() + 1); h < j; h++) {
                dp[j] = max(dp[j], dp[h] + v[i][j - h]);
            }
        }
    }
    cout << dp[k] << endl;
}


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

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vpll> vvpll;
typedef unordered_map<ll, ll> um;
typedef unordered_set<ll> us;

#define fastio ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define ts ll t; in(t) while (t--) solve();
#define ks ll t; in(t) FOR(i, 1, t+1) out("Case #" << i << ": " << solve());
#define endl '\n'
#define ln cout << endl;
#define in(x) cin >> x;
#define out(x) cout << x << endl;
#define flush cout << flush;
#define reset(a, b) memset(a, b, sizeof(a));
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define FOR(i, a, b) for (ll i = a; i < b; ++i)
#define FORI(i, a, b, c) for (ll i = a; i < b; i += c)
#define FORD(i, a, b) for (ll i = a; i > b; --i)
#define FOREACH(it, v, r) for (auto it = v.begin() + r; it != v.end(); it++)
#define FORALL(it, v) for (auto it : v)
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define vin(v, x) vll v(x); FOR(i, 0, x) in(v[i])
#define all(v) v.begin(), v.end()
#define allr(v, r) v.begin(), v.begin() + r
#define showv(v) FORALL(it, v) cout << it << ' '; ln
#define printv(v) FORALL(it, v) out(it)
#define show2d(v) FORALL(it, v) { FORALL(j, it) cout << j << ' '; ln}
#define showm(v) FORALL(it, v) cout << it.F << ": " << it.S << ' '; ln
#define sortv(v) sort(all(v));
#define revv(v) reverse(all(v));
#define maxv(v) *max_element(all(v))
#define minv(v) *min_element(all(v))
#define gcd __gcd
#define checkbit(n, i) (n >> i) & 1               // check ith bit
#define bitcount __builtin_popcount               // count set bits
#define firstbitindex __builtin_ctz               // count trailing zeros
#define lastbitindex __builtin_clz                // count leading zeros
#define bitparity __builtin_parity                // check set bits are even or odd
#define findv(v, x) (find(all(v), x) != v.end())
#define findsm(u, x) (u.find(x) != u.end())
#define findstr(s, x) (s.find(x) != string::npos)
#define sz(a) a.size()
#define precise(x) cout << fixed << setprecision(x);

const ll MAXN = 1e6 + 5, MOD = 998244353, SIZE = 2e7;//, INF = 0x7f7f7f7f7f7f7f7f;
const double EPS = 1e-9, PI = acos(-1);
const int INFi = 0x7f7f7f7f;

//<<------Declare Variables Here----->>//
ll c;
string s, t;

//<<-----Implement Functions Here---->>//
void solve()
{
	in(s >> t)
	c = 0;
	FOR(i, 0, sz(s))
		if(s[i] != t[i])
			++c;
	out(c)
}

//<<----------Start of Main---------->>//
int main()
{
    fastio
    //ts
    solve();
    return 0;
}

Measured memory_bytes: 3816
import math
n = int(input())

def sosuuhantei(x):
    p = x
    if p < 2:
        return false
    elif  n == 2:
        return p
    else:
        for i in range(3,math.floor(math.sqrt(x)) + 1,2):
            if x % i == 0:
                return False
        else:
             return x

sosulist = []

if n < 2:
    None
elif n == 2:
    sosulist.append(2)
else:
    sosulist.append(2)
    for i in range(3,n+1,2):
        sosulist.append(sosuuhantei(i))

while False in sosulist:
    sosulist.remove(False)

wari_dict = {}
nn = 1
if n > 1:
    for i in range(1,n+1):
        nn = nn * i

for i in range(len(sosulist)):
    kaisuu = 0
    j = nn
    while j % sosulist[i] == 0:
        kaisuu = kaisuu + 1
        j = j // sosulist[i]
    wari_dict.update({sosulist[i]:kaisuu})
                
#print(wari_dict)

goal = 1
for y in wari_dict.values():
    goal = goal * (y + 1)
    if goal > (10 ** 9 + 7):
        goal = goal % (10 ** 9 + 7)
        
print(goal)


Measured memory_bytes: 3064
import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.{Map, Stack, Queue, PriorityQueue, Set}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val MOD = 998244353
  val N, M, K = in.next().toInt  

  //
  val p = MOD
  // 素数modulo `p` の世界での割り算

  // (x ^ n) % p
  def repeatSquares(x: Long, n: Int): Long = {
    def func(x: Long, n: Int): Long = {
      if(n == 0)
        1
      else if(n % 2 == 0)
        func(x*x % p, n/2)
      else
        (x * func(x*x % p, n/2)) % p
    }

    if (x == 0 && n != 0) 0
    else func(x, n)
  }


  // a / b
  def modDiv(a: Long, b: Int): Long = {
    val numer = a % p
    val denom = repeatSquares(b, p-2)

    (numer * denom) % p
  }

  val mc = new ModComb(N, MOD)

  var base: Long = repeatSquares(M-1, N-1)
  base *= M
  base %= MOD

  var ans = base


  for (i <- 1 to K) {
    base = modDiv(base, M-1)

    val hoge = (base * mc.comb(N-1, i)) % MOD

    ans += hoge
    ans %= MOD
  }

  if (N == 1)
    println(M)
  else if (M == 1 && K == N-1)
    println(M)
  else
    println(ans)
}


class ModComb(maxNum: Int, mod: Long) {

  private def repeatSquares(x: Long, n: Long): Long = {
    if(n == 0)
      1
    else if(n % 2 == 0)
      repeatSquares(x*x % mod, n/2)
    else
      (x * repeatSquares(x*x % mod, n/2)) % mod
  }

  val fact = new Array[Long](maxNum + 1)

  fact(0) = 1
  for (i <- 1 to maxNum)
    fact(i) = (i * fact(i-1)) % mod

  val factInv = new Array[Long](maxNum + 1)

  factInv(maxNum) = repeatSquares(fact(maxNum), mod-2)
  for (i <- (1 to maxNum).reverse)
    factInv(i-1) = (i * factInv(i)) % mod


  // nCk
  def comb(n: Int, k: Int): Long = {
    val numer = fact(n)
    val denom = (factInv(n-k) * factInv(k)) % mod

    (numer * denom) % mod
  }

}

object Sub {
  def print2DimArray[A](mat: Array[Array[A]]): Unit = {
    mat.foreach(lin => println(lin.toList))
  }
}

class InputReader(stream: InputStream) {
  private[this] val reader = new BufferedReader(new InputStreamReader(stream))
  private[this] var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}


Measured memory_bytes: 58580
import java.util.*;
import java.io.*;

public class Main {
	static PrintWriter out;
	static StringBuilder sb;
	static int mod = 998244353;
	static int inf = (int) 1e15;
	static ArrayList<Integer>[] ad;
	static int n, s;
	static int[][][] memo;
	static int[] a;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int k=sc.nextInt();
		int n = sc.nextInt();
		int[] a = new int[n];
		long ans = Long.MAX_VALUE;
		for (int i = 0; i < n; i++)
			a[i] = sc.nextInt();
		ans = a[n - 1] - a[0];
		for (int i = 1; i < n; i++) {
               ans=Math.min(ans, k-a[i]+a[i-1]);
		}
		System.out.println(ans);
		out.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public int[] nextArrInt(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}


Measured memory_bytes: 47956
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <unordered_map>
using namespace std;
typedef long long ll;
 
ll lcd( ll a, ll b ){
  ll x = a * b;
  if( a<b ) swap(a,b);
  ll r = a % b;
  while( r != 0 ){
    a = b;
    b = r;
    r = a % b;
  }
  return x/b;
}

int main( int argc, char* argv[]) {
  ll N, M;
  string S, T;
  cin >> N >> M;
  S.reserve(N+1);
  T.reserve(M+1);
  scanf("%s", &S[0]);
  scanf("%s", &T[0]);
  ll LCD = lcd(N,M);
  ll iN = LCD/N;
  ll iM = LCD/M;
  for( ll l=1; l*LCD<=N*M; ++l ){
      ll L = l*LCD;
      ll n = l*iN;
      ll m = l*iM;
      ll a = l*iN*iM;
      bool good = true;
      for( ll i=0; i<L; i+=a ){
         if( S[i/n] != T[i/m] ){
              good = false;
              break;
          }
      }
      if( good ){
          cout << L << endl;
          return 0;
      }
  }
  cout << -1 << endl;
  return 0;
}

Measured memory_bytes: 384
n=int(input())

for x in range(1,3501):
    for y in range(1,3501):
        if (4*x*y-n*y-n*x)>0 and (n*x*y)%(4*x*y-n*y-n*x)==0:
            z=(n*x*y)//(4*x*y-n*y-n*x)
            print(x,y,z)
            exit()


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

#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define size_t unsigned long long
#define ll long long
#define rep(i,a) for(int i=0;i<(a);i++)
#define repr(i,a) for(int i=(int)(a)-1;i>=0;i--)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(int)(b)-1;i>=a;i--)
#define ALL(a) a.begin(), a.end()
using namespace std;
int si() { int x; scanf("%d", &x); return x; }
long long sl() { long long x; scanf("%lld", &x); return x; }
string ss() { string x; cin >> x; return x; }
void pi(int x) { printf("%d ", x); }
void pl(long long x) { printf("%lld ", x); }
void pd(double x) { printf("%.15f ", x); }
void ps(const string &s) { printf("%s ", s.c_str()); }
void br() { putchar('\n'); }

const int MOD = 1e9 + 7;

struct mint {
    int n;
    mint(int n_ = 0) : n(n_) {}
};

mint operator+(mint a, mint b) { a.n += b.n; if (a.n >= MOD) a.n -= MOD; return a; }
mint operator-(mint a, mint b) { a.n -= b.n; if (a.n < 0) a.n += MOD; return a; }
mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }

typedef pair<int, int> P;

const int N = 55;
string s,t="Yes";
int n, d[N];
ll b, c;
vector<P> p;
int g[N];

int main () {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> s;
  for(int i=0; i < s.length(); i++) {
    if(i%2) {
      if(s[i] == 'R') {t = "No"; break;}
    } else {
      if(s[i] == 'L') {t = "No"; break;}
    }
  }
  ps(t);
  br();
}


Measured memory_bytes: 256
def right(a,b,a1,a2,a3,a4,a5,a6):
    b1=a6
    b2=a5
    b3=a4
    b4=a3
    b5=a2
    b6=a1
  
    if a>b:
        tmp_a=a
        a=b
        b=tmp_a
        
    if [a,b]==[a1,a2]:
        right_side=[a3,b3]
    elif [a,b]==[a1,a3]:
        right_side=[a5,b5]
    elif [a,b]==[a1,a4]:
        right_side=[a2,b2]
    elif [a,b]==[a1, a5]:
        right_side=[a4,b4]
    elif [a,b]==[a2, a3]:
        right_side=[a1,b1]
    elif [a, b]==[a2, a4]:
        right_side=[a6,b6]
    elif [a,b]==[a2,a6]:
        right_side=[a3,b3]
    elif [a,b]==[a3, a5]:
        right_side=[a1,b1]
    elif [a,b]==[a3, a6]:
        right_side=[a5,b5]
    elif [a, b]==[a4, a5]:
        right_side=[a6,b6]
    elif [a,b]==[a4,a6]:
        right_side=[a2,b2]
    elif [a,b]==[a5,a6]:
        right_side=[a4,b4]
  
    return right_side
    

initial=list( map(int,input().split()))
num_of_q=int(input())

for i in range(0, num_of_q):
    a=list(map(int, input().split()))
    flag=0
    if a[0]>a[1]:
        flag=1
    answer=right(*a,*initial)
    print(answer[flag])
    
    



Measured memory_bytes: 5604
n,m=map(int,input().split())
a=[list(input())for i in range(n)]
b=[list(input())for j in range(m)]
for i in range(n-m+1):
    for x in range(n-m+1):
        if a[i][x:x+m]==b[0]:
            flag=1
            for j in range(0,m):
                if a[i+j][x:x+m]!=b[j]:
                    flag=0
            if flag:
                print("Yes")
                exit()
print("No")

Measured memory_bytes: 3064
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {
        n: usize,
        l: usize,
        s: [String; n],
    };
    let mut ss = s.clone();
    ss.sort();
    for s in ss {
        print!("{}", s);
    }
}


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

const int64_t INF = 2 << 30;

int main() {
  int a,b;
  cin>>a>>b;
  string A,B;
  for(int i=0;i<b;i++){
    A+=to_string(a);
  }
  for(int i=0;i<a;i++){
    B+=to_string(b);
  }
  string ans=B;
  if(A<B){
    ans=A;
  }
  cout<<ans<<endl;
}  

Measured memory_bytes: 256
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int S = sc.nextInt();
		int h = S / 3600;
		int m = S % 3600 / 60;
		int s = S % 3600 % 60;
		System.out.println(h + ":" + m + ":" + s);
	}
}


Measured memory_bytes: 26268
import sys
input = sys.stdin.readline

h, w = [int(x) for x in input().split()]

if h % 3 == 0 or 2 % 3 == 0:
    print(0)
    exit()

if h % 3 == 1:
    d = h // 3 
else:
    d = h // 3 + 1
block = [w * d, (h-d) * (w // 2), (h-d) * (w - w // 2)]
res1 = max(block) - min(block)
block = [w * d, w * d, w * (h - d * 2)]
res2 = max(block) - min(block)

if w % 3 == 1:
    d = w // 3 
else:
    d = w // 3 + 1
block = [h * d, (w-d) * (h // 2), (w-d) * (h - h // 2)]
res3 = max(block) - min(block)
block = [h * d, h * d, h * (w - d * 2)]
res4 = max(block) - min(block)

print(min(res1, res2, res3, res4))





Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,s,e) for (int i=s;i<(e);i++)
#define All(v) (v).begin(),(v).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
using namespace std;
typedef long long llint;
typedef pair<int, int> P;
const int MOD = (int)1e9 + 7;
const int INF = 999999999;

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

    int count = 0;
    string s;
    cin >> s;
    
    int ct = 1;
    REP(i, 3){
        if(s[i] == s[i+1]) ct++;
        else ct = 1;
        if(ct == 3){
            puts("Yes");
            return 0;
        }
    }
    puts("No");
    return 0;
}


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

int main()
{
	int g[4][4] = {};
	for (int i = 0; i < 3; i++) {
		int a, b;
		cin >> a >> b; --a, --b;
		g[a][b] = g[b][a] = 1;
	}
	vector<int> t = { 0, 1, 2, 3 };
	bool ok = false;
	do {
		if (g[t[0]][t[1]] && g[t[1]][t[2]] && g[t[2]][t[3]]) {
			ok = true;
			break;
		}
	} while (next_permutation(t.begin(), t.end()));
	puts(ok ? "YES" : "NO");
	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 19:05:56 2019

@author: yuta
"""

N = int(input())
money = [list(input().split()) for _ in range(N)]

def main(m):
    otoshidama = 0
    for i in range(len(m)):
        if m[i][1] == "JPY":
            otoshidama += (int(m[i][0]))
        else:
            otoshidama += (float(m[i][0])*380000)
    print(otoshidama)
main(money)

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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;

static constexpr ll INF = 1LL << 60;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);

int main(int argc, char* argv[]) {
  long long N;
  scanf("%lld", &N);

  cout << (N * (N - 1)) / 2 << endl;

  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

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

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(signed i=0;i<n;++i)
#define int long long
#define str string
#define vint vector<signed>
#define pint pair<signed,signed>
#define pb(a) push_back(a)
#define all(v) v.begin(),v.end()
#define yn(b) cout<<((b)?"Yes":"No")<<endl
#define YN(b) cout<<((b)?"YES":"NO")<<endl

signed main(){
  int n;
  cin>>n;
  int a[n];
  rep(i,n)cin>>a[i];
  int fm=0;
  rep(i,n){
    fm+=(a[i]-1);
  }
  cout<<fm;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define MAX 100000
void inarray(int a[], int n){
    for(int i = 0; i < n; i++) cin >> a[i];
}

int main(){
    int n; cin >> n;
    int a[n]; inarray(a,n);
    sort(a,a+n);
    int ans = INT_MAX;
    for(int i = a[0]; i <= a[n-1]; i++){
        int c = 0;
        for(int j = 0; j < n; j++){
            c += (i - a[j]) * (i - a[j]);
        }
        ans = min(ans, c);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// 2011/05/30 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		double a, b, c, d, e, f;
		cin >> a;
		if(cin.eof())
			break;
		cin >> b >> c >> d >> e >> f;

		double x = (c*e-f*b)/(a*e-d*b);
		if(x==-0.0)
			x = 0.0;
		double y = (c*d-f*a)/(b*d-e*a);
		if(y==-0.0)
			y = 0.0;

		cout.precision(3);
		cout << fixed << x;
		cout << ' ';
		cout.precision(3);
		cout << fixed << y;
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 0
#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);
  }
  
  int sum=0;
  for(int i=0;i<n;i++){
    sum+=vec.at(i);
  }
  sort(vec.begin(),vec.end());
  
  if(vec.at(n-1)<sum-vec.at(n-1)){
    cout << "Yes";
  }
  else{
    cout << "No";
  }
}

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include <math.h>
#include<stdio.h>
#include <climits>
#include<algorithm>
#include<string>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define LL  long long 
#define Pi 3.14159265358979;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int i = 0, j = 0;//ループ用配列

	int n;
	vector<int> p;
	int x,d=INT_MAX;
	int ans=0;

	cin >> n;
	
	rep(i,n){
		cin >> x;
		p.push_back(x);
	}

	
	rep(i, n) {
		if (d > p[i]) {
			d = p[i];
			ans++;
		}
	}
	cout << ans << "\n";
}


Measured memory_bytes: 1400
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		int count = 0;
		int ans = 0;
		for(int i = 100; i > 0; i--) {
			if((A % i == 0) && (B % i == 0)) {
				count++;
			}
			if(count == K) {
				ans = i;
				break;
			}
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 23892
#include<bits/stdc++.h>
using namespace std;
#define ran 222222
int n,ls,lt;
char s[ran],t[ran];
char ss[ran*2],tt[ran*2];
bool d[ran];
bool cmp(char*s,char*t){
	bool rev = false;
	int ls1 = ls, lt1 = lt;
	if(ls > lt){swap(s,t);swap(ls1,lt1);rev=true;}
	int ls2 = ls1, lt2 = lt1;
	while(ls2 <= n){
		memcpy(s+ls2,s,sizeof(char)*ls1);
		ls2 += ls1;
	}
	while(lt2 <= n){
		memcpy(t+lt2,s,sizeof(char)*ls1);
		lt2 += ls1;
	}
	for(int i=0; i<n; i++)
		if(s[i] != t[i])
			return !rev ? s[i] < t[i] : s[i] > t[i];
	return !rev;
}
int main(){
	scanf("%d%s%s",&n,s,t);
	ls = strlen(s), lt = strlen(t);
	memcpy(ss,s,sizeof(s));
	memcpy(tt,t,sizeof(t));
	bool ff = cmp(ss,tt);
	d[0] = true;
	for(int i=0; i<n; i++)if(d[i]){
		if(i+ls <= n)d[i+ls] = true;
		if(i+lt <= n)d[i+lt] = true;
	}
	int cur = 0;
	while(cur < n){
		bool ff1 = cur + ls <= n && d[n-cur-ls];
		bool ff2 = cur + lt <= n && d[n-cur-lt];
		if(ff1 && (ff || !ff2)){
			printf("%s",s);
			cur += ls;
		}else{
			printf("%s",t);
			cur += lt;
		}
	}
	puts("");
	return 0;
}


Measured memory_bytes: 1664
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {

	int[][] f;
	int h;

	public static void main(String[] args) throws FileNotFoundException {
		new Main().run();
	}

	private void run() {
		Scanner sc = new Scanner( System.in );
		while(true){
			h = sc.nextInt();
			f = new int [h][5];
			if(h==0) return;
			for(int i=0;i<h;i++){
				for(int j=0;j<5;j++){
					f[i][j] = sc.nextInt();
				}
			}
			int score = 0;
			while(true){
				while(true){
					int delScore = delete();
					if(delScore==-1) break;
					score += delScore;
				}
				int cntDown = down2();
				if(cntDown==0) break;
			}
			System.out.println(score);
		}
	}

	private int down2() {
		int res = 0;
		int id = h - 1;
		for (int i = 0; i < 5; i++) {
			id = h - 1;
			for (int j = h - 1; 0 <= j; j--) {
				if (f[j][i] != -1) {
					f[id][i] = f[j][i];
					if (id != j) {
						res++;
					}
					id--;
				}
			}
			for (int j = id; j >= 0; j--) {
				f[j][i] = -1;
			}
		}
		return res;
	}

	private int delete() {
		for(int i=0;i<h;i++){
			for(int j=0;j<5;j++){
				if(f[i][j]==-1) continue;
				int start = j;
				int goal = j;
				while(true){
					if(goal+1>=5) break;
					if(f[i][start]==f[i][goal+1]){
						goal++;
					}
					else{
						break;
					}
				}
				if(goal-start+1>=3){
					int element = f[i][start];
					for(int k=start;k<=goal;k++){
						f[i][k] = -1;
					}
					return (goal-start+1)*element;
				}
			}
		}
		return -1;
	}
}

Measured memory_bytes: 50036
n, l = map(int, input().split())

taste = []
sum = 0

for i in range(n):
  taste.append( l + i)
  sum += l + i
  
#print("sum is",sum)
#print("tatse is", taste)

zero_near_apple = taste[0]

for i in range(0, n-1):
  if abs(taste[i]) > abs(taste[i+1]):
    zero_near_apple = taste[i+1]

#print(zero_near_apple)
print(sum - zero_near_apple)

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

int main()
{
	string S, T;
	cin >> S >> T;

	int N = S.size();
	string ans = "No";
	for( int k = 0; k < N; k++ ) {
		int flag = 0;
		for( int i = 0; i < N; i++ ) {
			if( S[(i + k) % N] != T[i] ) {
				flag = 1;
				break;
			}
		}
		if( flag == 0 ) {
			ans = "Yes";
			break;
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 3604
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<functional>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define PII pair<int,int>
#define PLI pair<long long, int>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
using namespace std;
int main(){
    int N, K;
    cin >> N >> K;
    cout << N - K + 1 << endl;
    return 0;
}


Measured memory_bytes: 764
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;
typedef long long ll;
const ll infl = 1LL << 60;
ll mul(ll a, ll b)
{
    if (infl / a < b)
        return infl;
    return min(infl, a * b);
}
ll gcd(ll a, ll b) { return a ? gcd(b % a, a) : b; }
ll lcm(ll a, ll b)
{
    if (a == infl || b == infl)
        return infl;
    return mul(a / gcd(a, b), b);
}

int main(void)
{
    int n;
    cin >> n;
    long long ans;
    REP(i, n)
    {
        long long a;
        cin >> a;
        if (i == 0)
            ans = a;
        else
        {
            ans = lcm(ans, a);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
 
using namespace std;
 
int main()
{
  int N,W; cin >> N >> W;
  vector<unsigned long> w, v;
  
  for (int i = 0; i < N; ++i) {
    unsigned long tw,tv; cin >> tw >> tv;
    w.push_back(tw);
    v.push_back(tv);
  }
  
  unsigned long dp[N+1][W+1];
  for (int i=0; i < W+1; ++i) dp[0][i] = 0;

  for (int i=1; i <= N; ++i){
  	 for (int j=0; j <= W; ++j){
       if (j < w[i-1]) dp[i][j] = dp[i-1][j]; 
       else dp[i][j] = max(dp[i-1][j-w[i-1]] + v[i-1], dp[i-1][j]);
       // cout << dp[i][j] << " ";
     }
    // cout << endl;
  }
  cout << dp[N][W];
  return 0;
}

Measured memory_bytes: 79104
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define int long long
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pii>
#define endl '\n'
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define in insert
#define rep(i,a,b) for(int i = a ; i < b ; i++)
#define repr(i,a,b) for(int i = b ; i > a ; i--)

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

signed main(){
    fast;
    int k, ans=0;
    cin >> k;
    for(int i=1; i<=k; i++){
        for(int j=1; j<=k; j++){
            for(int r=1; r<=k; r++){
                ans+= gcd(r , gcd(i,j));
            }
        }
    }
    cout << ans;
}

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

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

using namespace std;

int main()
{
  int h, n;
  cin >> h >> n;
  int tmp;
  int total = 0;
  rep(i, n)
  {
    cin >> tmp;
    total += tmp;
  }
  string ans = h - total > 0 ? "No" : "Yes";
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>    
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//using namespace __gnu_pbds; 
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb  push_back
#define show(x) cout<<(#x)<<" : "<<x<<endl;
#define ll  long long
#define ld  long double
#define fill(a,val) memset(a,val,sizeof(a))
#define mp  make_pair
#define ff  first
#define ss  second
#define pii pair<ll,ll>
#define sq(x) ((x)*(x))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define endl "\n"
#define int long long 
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
const ll MOD     = 1000*1000*1000+7;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7;
const ll MOD2    = 998244353;
const ll N       = 2005;
const ll N2      = 70;
const ld PI  = 3.141592653589793;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> tree_set;
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);} 
ll power(ll x,ll y,ll p = LLONG_MAX ){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
ll lcm(ll a , ll b){return (a*b)/gcd(a,b);}

signed main()
{
    fastio();
    //cout<<fixed<<setprecision(20);
    //CHECK for LONG LONG and LONG DOUBLE
    /*comment for all except cc/cf    
    #ifndef ONLINE_JUDGE    
           freopen("input.txt","r",stdin);
           freopen("output.txt","w",stdout);
    #endif//*/
    int n;
    cin>>n;
    int a[n];
    for (int i = 0; i < n; ++i)
    {
        cin>>a[i];
    }
    int flag=0;
    for (int i = 0; i < n; ++i)
    {
        if(a[i]%2)
            continue;
        if(a[i]%3&&a[i]%5)
            flag++;
    }
    if(flag)
        cout<<"DENIED"<<endl;
    else
        cout<<"APPROVED"<<endl;
    printclock;
    return 0;
}


Measured memory_bytes: 256
import sys
from collections import Counter
from operator import itemgetter
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
A = MAP()

C = Counter(A).most_common()
C = sorted(C, key=itemgetter(0), reverse=True)

x, y = 0, 0
for c in C:
	if c[1] >= 4:
		if c[0] >= x:
			x, y = c[0], c[0]
		else:
			y = c[0]
	elif c[1] >= 2:
		if x != 0: y = c[0]
		else: x = c[0]
	if x!=0 and y!=0: break

#print(x, y)
print(x*y)

Measured memory_bytes: 73496
N = int(input())
p = [int(i) for i in input().split()]
cnt = 0
a = []

for i in range(N-1):
    if p[i]>p[i+1]:
        cnt+=1

if cnt>2 or cnt==1:
    print("NO")
    exit()
if cnt==0:
    print("YES")
    exit()
else:
    for i in range(N-1):
        if p[i]>p[i+1]:
            a.append(p[i])
            a.append(p[i+1])
if a[0]>a[2] and a[1]>a[3]:
    print("YES")      
else:
    print("NO") 

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

int main() {
    string w;
    cin>>w;

    bool jdg=true;

    rep(i,0,w.size()){
        int cnt=0;
        rep(j,0,w.size()){
            if(w[i]==w[j]){
                cnt++;
            }
        }
        if(cnt%2!=0){
            jdg=false;
            break;
        }
    }
    if(jdg){
        cout<<"Yes"<<endl;
    }
    else {
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 256
list1 = [int(a) for a in input().split()]
list1_0 = list1[0] #A
list1_1 = list1[1] #B
 
abc_0 = list1_0 * list1_1 * 1
abc_1 = list1_0 * list1_1 * 2
abc_2 = list1_0 * list1_1 * 3
 
if abc_0 % 2 == 1 or abc_1 % 2 == 1 or abc_2 % 2 == 1:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3060
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn vs(a: &mut Vec<Vec<usize>>, n: usize, p1: usize, p2: usize, done: &mut Vec<bool>) -> bool {
    if done[p2 - 1] {
        a[p1 - 1].push(p2);
        done[p1 - 1] = true;
        return false;
    } else if let Some(p3) = a[p2 - 1].pop() {
        if p1 != p3 {
            done[p1 - 1] = true;
            a[p1 - 1].push(p2);
            return vs(a, n, p2, p3, done);
        }
        done[p1 - 1] = true;
        done[p2 - 1] = true;
        return true;
    }
    false
}

fn day(a: &mut Vec<Vec<usize>>, n: usize) -> u32 {
    let mut done: Vec<bool> = vec![false; n];
    let mut cnt: u32 = 0;
    for p1 in 1..(n + 1) {
        if done[p1 - 1] {
            continue;
        } else if let Some(p2) = a[p1 - 1].pop() {
            if vs(a, n, p1, p2, &mut done) {
                cnt += 1;
            }
        }
    }
    cnt
}

fn all(a: &mut Vec<Vec<usize>>, n: usize) -> i32 {
    let mut vs_cnt: u32 = 0;
    let mut day_cnt: i32 = 0;

    while vs_cnt < ((n * (n - 1)) / 2) as u32 {
        let tmp = day(a, n);
        if tmp == 0 {
            day_cnt = -1;
            break;
        } else {
            vs_cnt += tmp;
        }
        day_cnt += 1;
    }

    return day_cnt;
}

fn main() {
    let nk: Vec<u32> = read_vec();
    let hv: Vec<u32> = read_vec();
    let k: u32 = nk[1];
    let mut ans: u32 = 0;
    for h in hv {
        if h >= k {
            ans += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<set>
#include<algorithm>
#include<cmath>
#include<stack>
#include<math.h>
#include<queue>
#define mem(x) memset(x,0,sizeof(x)) 
#define sca(x) scanf("%d",&x)
#define scaa(x,y) scanf("%d%d",&x,&y)
#define prt(x) printf("%d\n",x)
#define inf 0x7f7f7f7f
#define io ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#pragma GCC optimize(2)
using namespace std;
const double pi=acos(-1); 
const double eps=1e-10;
typedef pair<long,long> pll;
typedef pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<string,string> pcc;
typedef pair<double,double> pbb;
int a[200005];
int n,k;
bool check(int x)
{
	int d=k;
	for(int i=1;i<=n;i++)
	{
		if(a[i]>x)
		{
			int y=a[i]/x;
			if(a[i]%x==0)
			y++;
			if(d<y)
			return false;
			else
			d-=y;
		}
	}
	return true;
}
int main()
{	
	scaa(n,k);
	int minn=inf,maxx=-1;
	for(int i=1;i<=n;i++)
	{
		sca(a[i]);
		minn=min(minn,a[i]);
		maxx=max(maxx,a[i]);
	}
	int l=1,r=maxx;
	while(l<r)
	{
		int mid=(l+r)/2;
		if(check(mid))
		{
			r=mid;
		}
		else
		l=mid+1;
	}
	prt(l);
}

Measured memory_bytes: 4552
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<queue>
#define _USE_MATH_DEFINES
#include<math.h>
#include<cmath>
#include<ctime>
#include<map>
#include<typeinfo>
#define R(i, n) for(int i = 0;i < n; i++)
#define R1(i, n) for(int i = 1; i <= n; i++)
#define S(a) scanf("%d", &a)
#define S2(a, b) scanf("%d%d", &a, &b)
#define S3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define SL(a) scanf("%lld", &a)
#define SL2(a, b) scanf("%lld%lld", &a, &b)
#define SL3(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)
#define SC(a) scanf("%c", &a)
#define P(a) printf("%d", a)
#define PL(a) printf("%lld", a)
#define PY printf("YES")
#define PN printf("NO")
#define Py printf("Yes")
#define Pn printf("No")
using namespace std;
using ll = long long;
using PR = pair<int, int>;
const ll MOD = 1e+9 + 7;
const int INF = 1e+9;
const double PI = acos(-1);

int main() {
	int n, k;
	S2(n, k);
	vector<int> v(n);
	R(i, n) {
		S(v[i]);
	}
	sort(v.begin(), v.end());
	int ans = 0;
	R(i, k) {
		ans += v[i];
	}
	P(ans);
}

Measured memory_bytes: 3756
#include<bits/stdc++.h>
#define N 100100
using namespace std;
int a[N];
long long st[N],b[N];
int main(){
	int n;
	long long sum=0,k;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
		sum+=a[i];
	}
	a[n]=a[0];
	if(sum%(1LL*n*(n+1)/2)) puts("NO");
	else{
		bool flag=true;
		k=sum*2/n/(n+1);
		for(int i=1;i<=n;i++){
			st[i]=(a[i-1]+k-a[i])/n;
			if(st[i]<0||(a[i-1]+k-a[i])%n) flag=false;
			b[0]+=st[i]*(n+1-i);
		}
		if(a[0]!=b[0]) flag=false;
		for(int i=1;i<n;i++){
			b[i]=b[i-1]+k-1LL*st[i]*n;
			if(a[i]!=b[i]){
				flag=false;
				break;
			}
		}
		if(flag) puts("YES");
		else puts("NO");
	}
	return 0;
}

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

using namespace std;
using ll = long long;

class Scc {
private:
	int n;
	vector<vector<int>> edge, rev;
	vector<int>  post_order;
	vector<bool> seen0, seen1;
	vector<int>  typea;
	vector<vector<int>> new_edge;
	int ord;
	int type_num;

	void dfs0(int v) {
		if(seen0[v])return;
		seen0[v] = true;
		for(auto i : edge[v]) {
			dfs0(i);
		}
		post_order[v] = ord++;
	}

	void dfs1(int v, int typ) {
		if(seen1[v])return;
		seen1[v] = true;
		typea[v] = typ;
		for(auto i : rev[v]) {
			dfs1(i, typ);
		}
	}


public:


	int types(){return type_num;}
	int type(int vertex){return typea[vertex];}

	Scc(const vector<vector<int>>& _edge):edge(_edge) {
		n = edge.size();
		typea.resize(n), post_order.resize(n), seen0.resize(n), seen1.resize(n), rev.resize(n);
		ord = 0;
		for(int i = 0; i < n; i++)dfs0(i);
		for(int i = 0; i < n; i++) {
			for(auto j : edge[i])rev[j].push_back(i);
		}
		vector<int> dfs1_ord(n);
		for(int i = 0; i < n; i++)dfs1_ord[post_order[i]] = i;
		type_num = 0;
		for(int i = n - 1; i >= 0; i--)if(!seen1[dfs1_ord[i]])dfs1(dfs1_ord[i], type_num++);
	}
};

/*
	Constructor   : O(V)
	Scc::types()  : O(1) 強連結成分の数 
	Scc::type(int): O(1) 引数がどの強連結成分に属するか(type(i) < type(j)ならばトポロジカルソート順でi < j)
*/


int main()
{
	int n, m; cin >> n >> m;
	vector<vector<int>> hen(n);
	for(int i = 0; i < m; i++) {
		int a, b; cin >> a >> b;
		hen[a].push_back(b);
	}
	Scc scc(hen);
	cout << scc.types() << endl;
	vector<vector<int>> type(scc.types());
	for(int i = 0; i < n; i++)type[scc.type(i)].push_back(i);
	for(int i = 0; i < scc.types(); i++) {
		int ns = type[i].size();
		cout << ns << " ";
		for(int j = 0; j < ns; j++)cout << type[i][j] << (j == ns - 1 ? '\n' : ' ');
	}
	return 0;
}


Measured memory_bytes: 101240
#include<iostream>
#include<memory.h>
#include<map>

using namespace std;

int main()
{
    bool a[4][13];
    map<char,int> m;
    map<int,char> m1;

    m.insert(make_pair('S',0));
    m.insert(make_pair('H',1));
    m.insert(make_pair('C',2));
    m.insert(make_pair('D',3));

    m1.insert(make_pair(0,'S'));
    m1.insert(make_pair(1,'H'));
    m1.insert(make_pair(2,'C'));
    m1.insert(make_pair(3,'D'));

    memset(a,0,sizeof(a));

    int n;

    cin>>n;

    char ch;
    int b;
    for(int i=0;i<n;i++)
    {
        cin>>ch>>b;

        a[m[ch]][b-1]=true;
    }

    for(int i=0;i<4;i++)
    {
        for(int j=0;j<13;j++)
        {
            if(!a[i][j])
            {
                cout<<m1[i]<<" "<<j+1<<endl;
            }
        }
    }

    return 0;
}



Measured memory_bytes: 3080