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


int main() {
string s;
cin>>s;
int n=s.size();


bool flg= false;

if(s=="KIHBR") flg=true;

if(s=="KIHBRA") flg=true;
if(s=="KIHBAR") flg=true;
if(s=="KIHABR") flg=true;
if(s=="AKIHBR") flg=true;

if(s=="KIHBARA") flg=true;
if(s=="KIHABRA") flg=true;
if(s=="AKIHBRA") flg=true;
if(s=="KIHABAR") flg=true;
if(s=="AKIHBAR") flg=true;
if(s=="AKIHABR") flg=true;

if(s=="KIHABARA") flg=true;
if(s=="AKIHBARA") flg=true;
if(s=="AKIHABRA") flg=true;
if(s=="AKIHABAR") flg=true;

if(s=="AKIHABARA") flg=true;

if(flg) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include <math.h>
using namespace std;
int main(){
	char op;
	int a,b;
	for (;;){
		cin>>a>>op>>b;
	if(op=='?'){
		break;
	}
	if (op=='+'){
		cout<<a+b<<endl;
	}
	if (op=='-'){
		cout<<a-b<<endl;
	}
	if (op=='*')
		cout<<a*b<<endl;
	if (op=='/')
		cout<<a/b<<endl;
	}
			return 0;
}


Measured memory_bytes: 3068
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            //count???????????§???????????°???upStatus???????????°????????????????¶??????°???times????¶??????????????????°
            int count = 0, upStatus = 0, times = sc.nextInt();
            //0?????\???????????????break??????
            if (times == 0) {
                break;
            }
            for (int i = 0; i < times; i++) {
                //?¶?????????????String
                String legAction=sc.next();
                //?¶????????????????????????????????????£?????´??????upStatus???1????¶????/????????§????????´??????upStatus??????1?????????
                upStatus = (legAction.equals("lu") || legAction.equals("ru")) ? upStatus + 1 : upStatus - 1;
                /*????????°????????§???????????°?????¶??°???????????°?????????????????¶???/?\???°???????????°?????????????????¶???
                 ????????°?????????????????¶?????§?????£???????????????????¶????????????°??????????????£???????????????????????????1?????????*/
                if ((count % 2 == 0 && upStatus == 2)|| (count % 2 == 1 && upStatus == 0)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }
}

Measured memory_bytes: 37388
#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;

int main(void)
{
    string s, t;
    cin >> s >> t;
    int a, b;
    cin >> a >> b;
    string u;
    cin >> u;
    if (u == s)
    {
        cout << a - 1 << " " << b << endl;
    }
    else
    {

        cout << a << " " << b - 1 << endl;
    }
}

Measured memory_bytes: 256
import numpy as np
n,k = map(int,input().split())
a = np.array(list(map(int,input().split())))
a.sort()
posi = a[a>0]
zero = a[a==0]
nega = a[a<0]

def cnt(x):
    c = 0
    if x >= 0:
        c += len(zero)*n
    c += np.searchsorted(a, x // posi, side = 'right').sum()
    c += (n-np.searchsorted(a, (- x - 1) // (-nega), side = 'right')).sum()
    c -= np.count_nonzero(a * a <= x)
    return c // 2

l = - 10 ** 18
r = 10 ** 18
while l + 1 < r:
    m = (l + r) // 2
    if cnt(m) < k:
        l = m
    else:
        r = m
print(r)

Measured memory_bytes: 32300
#include<bits/stdc++.h>
using namespace std;
# define ll long long
# define int long long
# define mo 1000000000000007
#define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int dp[105][4][2],nn;
string s;
int k;
int help(int n,int k,int ch,int ex,int id)
{
   //cout<<n<<" "<<k<<endl;;
    //cout<<id<<" "<<nn<<endl;
    if(k<0 || n<0 || id==nn){
            if(n==0 && k==0)
            return 1;
        return 0;
    }
    if(n==0)
    {
        if(n==0 && k==0)
            return 1;
        return 0;
    }
    if(dp[n][k][ch]!=-1)
        return dp[n][k][ch];
    int an=0;
  if(ch==1)
  {
      for(int i=0;i<=s[id]-'0';i++){
             if(i==s[id]-'0'){
                    if(s[id]!='0'){
                an += help(n-1,k-1,1,i,id+1);
                    //an%=mo;
                    }
             else{
                an += help(n-1,k,1,i,id+1);
              //an%=mo;
             }
             }
                else if(i==0){
            an += help(n-1,k,0,i,id+1);
            //an%=mo;
                }
            else{

                an+=help(n-1,k-1,0,i,id+1);
             //an%=mo;
            }
      }
  }
  else
  {
      for(int i=0;i<=9;i++)
      {
          if(i==0){
            an+=help(n-1,k,0,i,id+1);
           //an%=mo;
          }
            else{

                an += help(n-1,k-1,0,i,id+1);
            // an %=mo;
            }
      }
  }
  dp[n][k][ch]=an;
  return an;
}
signed main(){
    gok

    //int k;
    cin>>s>>k;
    nn=s.size();
   // cout<<nn<<endl;
    memset(dp,-1,sizeof(dp));
    /*for(int i=0;i<100;i++)
        for(int j=0;j<4;j++)
        for(int k=0;k<2;k++)
        cout<<dp[i][j][k]<<" ";*/
    int an = help(nn,k,1,10,0);
    cout<<an;
     return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let cin = stdin();
    let cin = cin.lock();
    let s: String = cin
        .bytes() // Bytes
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace()) // c が whitespace である限り skip
        .take_while(|c| !c.is_whitespace()) // c が whitespace でない限り要素を返す
        .collect();
    s.parse().ok().expect("failed parsing")
}

fn main() {
    let t: String = read();
    let ss: String = read();
    let mut t = t.chars().collect::<Vec<char>>();
    let ss = ss.chars().collect::<Vec<char>>();
    let n = t.len();
    let m = ss.len();
    for i in 0..n {
        if n < (i + m) {
            break;
        }
        let j = n - i - m;
        let mut ok = true;
        for k in 0..m {
            if t[j + k] != '?' && t[j + k] != ss[k] {
                ok = false;
                break;
            }
        }
        if ok {
            for k in 0..m {
                t[j + k] = ss[k];
            }
            for k in 0..n {
                if t[k] == '?' {
                    t[k] = 'a';
                }
            }
            let ans: String = t.clone().into_iter().collect();
            println!("{}", ans);
            return;
        }
    }
    println!("UNRESTORABLE");
}


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

int main () {
    
    int n, m, x, y;
    cin >> n >> m;

    int mx = -1000000;
    int mn = 1000000;
    cin >> x;
    cin >> y;

    mx = max(mx, x);
    mn = min(mn, y);

    REP(i,n) {
        cin >> x;
        mx = max(mx, x);
    }

    REP(i,m) {
        cin >> y;
        mn = min(mn, y);
    }
    
    if(mx < mn) {
        cout << "No War" << endl;
    } else {
        cout << "War" << endl;
    } 
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <set> 
#include <iterator> 
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define ll long long
#define MOD 1000000007
#define nl cout<<endl
#define rt ll Q[100005]={0}
#define mp make_pair
#define test() ull t;cin>>t;while(t--)
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define oa(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n) for(int i=0;i<n;i++)cin>>a[i];
#define ov(a) for(int i=0;i<a.size();i++)cout<<a[i]<<" ";nl
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)


int main()
{
    fastio();

        int n;
        cin>>n;
        int a[3][n];
        for(int i=0;i<n;i++)
            cin>>a[0][i]>>a[1][i]>>a[2][i];
        int dp[3][n]={0};
        dp[0][0]=a[0][0];
        dp[1][0]=a[1][0];
        dp[2][0]=a[2][0];
        for(int i=1;i<n;i++)
        {
            dp[0][i]= max(dp[1][i-1]+a[0][i],dp[2][i-1]+a[0][i]);
            dp[1][i]= max(dp[0][i-1]+a[1][i],dp[2][i-1]+a[1][i]);
            dp[2][i]= max(dp[1][i-1]+a[2][i],dp[0][i-1]+a[2][i]);
        }
        cout<<max(dp[0][n-1],max(dp[1][n-1],dp[2][n-1]))<<endl;
      

}


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

int main(){
    while (true){
        int n; cin >> n;
        if (n == 0) break;
        double sum = 0;
        vector<int> v(n);
        for (int i = 0; i < n; i++){
            cin >> v[i];
            sum += v[i];
        }
        sum /= n;
        double d = 0;
        for (int i = 0; i < n; i++){
            d += (v[i]-sum)*(v[i]-sum);
        }
        d /= n;
        cout << fixed << setprecision(10);
        cout << sqrt(d) << endl;
    }
    return 0;
}


Measured memory_bytes: 3236
#include <iostream>
using namespace std;
int main(void){
    string s;
    cin >> s;
    int cnt = 0;
    for(int i = 0;i < s.size();i++){
        if(s[i] == 'x') cnt++;
    }
    if(cnt <= 7){
        cout << "YES" << endl;
        return 0;
    }else{
        cout << "NO" << endl;
        return 0;
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

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

    // 問題数
    int cases = sc.nextInt();
    // 提出数
    int numOfSubmits = sc.nextInt();

    // 各問題で誤った数を記録しておく
    int[] waEachProblems = new int[cases];
    // 各問題に正答したことがあるか否かを記録しておく
    Map<Integer, Boolean> map = new HashMap<>();
    // 上記の初期状態で記録する
    for (int i = 0; i < cases; i++) {
      map.put(i + 1, false);
      waEachProblems[i] = 0;
    }

    int waResult = 0;
    int acResult = 0;
    int caseNum;
    String submitResult;
    for (int i = 1; i <= numOfSubmits; i++) {
      caseNum = sc.nextInt();
      submitResult = sc.next();
      // 正答したことがない問題について処理を行う
      if (!map.get(caseNum)) {
        // 誤りであれば、当該問題の誤り数を加算する
        if (submitResult.equals("WA")) {
          waEachProblems[caseNum - 1]++;
        }
        // 正答であれば、正答数の記録、当該問題の誤り数の計上、および正答状況の保存を行う
        if (submitResult.equals("AC")) {
          acResult++;
          waResult += waEachProblems[caseNum - 1];
          map.put(caseNum, true);
        }
      }
    }
    System.out.println(acResult + " " + waResult);
  }
}


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

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1000000000;
const ll LINF = (ll) 4000000000000000000;
const ll MOD = (ll) 1000000007;
const double PI = acos(1.0);
const int limit = 100010;

#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep2(i,n) REP(i,1,n+1)
#define rep3(i,n) REP(i,0,n+1)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define repll(i,n) REPLL(i,0,n)
#define repll2(i,n) REPLL(i,1,n+1)
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define NP(v) next_permutation(v.begin(),v.end())
#define Size(s) (int) s.size()

//------------------------------------------------------

int main() {
    string s;
    cin >> s;
    cin >> s;
    stack<char> stk;
    for (auto c : s) {
        if (c == ')' && !stk.empty() && stk.top() == '(') stk.pop();
        else stk.push(c);
    }

    while (!stk.empty()) {
        if (stk.top() == '(') s = s + ')';
        else s = '(' + s;
        stk.pop();
    }

    cout << s << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN = 3e5 + 7;
ll ksm(ll a, ll b, ll res = 1)
{
    while (b) {if (b & 1) res *= a; a = a * a; b /= 2;}
    return res;
}
ll cal(int k, int n)
{
    if (n == 0) return 1;
    // (k * (k ^ n - 1)) / (k - 1)
    ll res = k * (ksm(k, n) - 1) / (k - 1);
    return res + 1;
}
int ans[MAXN];
int main()
{
    int k, n; scanf("%d%d", &k, &n);
    // ll need = (cal(k, n) - 1) / 2;
    // ll now = 0;
    // for (int i = 0; i < n; i++) now += cal(k, i);
    // now *= (k - 1) / 2;
    // now += n;
    // printf("need = %lld, now = %lld, det = %lld\n", need, now, now - need);
    // det = n / 2
    if (k & 1)
    {
        for (int i = 1; i <= n; i++) ans[i] = (k + 1) / 2;
        int now = n, det = n / 2;
        while (det--)
        {
            if (ans[now] == 1) now--;
            else 
            {
                ans[now]--;
                while (now < n) now++, ans[now] = k; 
            }
        }
        while(ans[now] == 0) now--;
        for (int i = 1; i <= now; i++) printf("%d%c", ans[i], " \n"[i == now]);
    }
    else 
    {
        ans[1] = k / 2;
        for (int i = 2; i <= n; i++) ans[i] = k;
        for (int i = 1; i <= n; i++) printf("%d%c", ans[i], " \n"[i == n]);
    }
    
    return 0;
}

Measured memory_bytes: 3456
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
#define MAX 100
int is[MAX];
int main(void) {
	string s, t;
	int n;
	int i = 0;
	cin >> n >> s >> t;
	for (int j = s.length() - t.length(); j < s.length(); ++j) {
		i = 0;
		while (s[j + i] == t[i] && i != t.length())
		{
			++i;
		}
		if (j + i == s.length()) {
			cout << s.length() + t.length() - i << endl;
			return 0;
		}
	}
	cout << s.length() + t.length() << endl;
	return 0;
}

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

using namespace std;

int main() {
    int n, x;
    cin >> n >> x;
    vector<int> l = vector<int>();
    for (int i = 0; i < n; i++) {
        int ll;
        cin >> ll;
        l.push_back(ll);
    }

    int c = 1;
    int d = 0;
    for (int i = 1; i <= n; i++) {
        d = d + l[i - 1];
        if (d <= x) {
            c++;
        }
    }
    cout << c << endl;

    return 0;
}

Measured memory_bytes: 888
// AtCoder165 C

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>

// qsortで用いる比較用関数．*a<*bならaが先になる．
int compare(const void* a, const void* b) {
    return *(int*)a - *(int*)b;
}

int main() {
    int i,j;
    double a,b;
    int sum = 0;

    scanf("%lf %lf", &a, &b);

    printf("%d", (int)ceil( (b-1)/(a-1) ));

    return 0;
}

Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<map>
#include<ctime>

using namespace std;

template <typename T>

inline T read()
{
	T x=0,f=1;char c=getchar();
	while(!isdigit(c))
	{if(c=='-') f=-f;c=getchar();}
	while(isdigit(c))
	{x=(x<<3)+(x<<1)+(c-48);c=getchar();}
	return x*f;
}

#define lint long long int
#define ulint unsigned lint

const int inf=1e9+1e7;

int main(void)
{

	// freopen("testdata.in","r",stdin);
	// freopen("testdata.out","w",stdout);

	int a,b,c,d;

	scanf("%d%d%d%d",&a,&b,&c,&d);

	while(true)
	{
		c-=b;
		if(c<=0)
		{
			puts("Yes");
			break;
		}
		a-=d;
		if(a<=0)
		{
			puts("No");
			break;
		}
	}

	return 0;

}

Measured memory_bytes: 3764
N, M = map(int, input().split())
xyz = [list(map(int, input().split())) for i in range(N)]

ans = 0
for i in range(2**3):
  coeff = []
  for j in range(3):
    coeff.append([1, -1][i>>j & 1])
  cakes = []
  for v in xyz:
    cakes.append([sum(map(lambda x:x[0]*x[1], zip(coeff, v)))]+v)
  cakes.sort(reverse=True)
  val = [0, 0, 0]
  for m in range(M):
    for j in range(3):
      val[j] += cakes[m][j+1]
  ans = max(ans, sum(map(abs, val)))

print(ans)

Measured memory_bytes: 3316
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;

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

        String in = next();
        if (in.endsWith("s")) {
            println(in + "es");
        } else {
            println(in + "s");
        }

        out.flush();
    }

    public static void println(Object o) {
        out.println(o);
    }

    public static void print(Object o) {
        out.print(o);
    }

    public static void printf(String format, Object... o) {
        out.printf(format, o);
    }

    public static String next() {
        return scanner.next();
    }

    public static int nextInt() {
        return Integer.parseInt(scanner.next());
    }

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

    public static double nextDouble() {
        return Double.parseDouble(scanner.next());
    }

    public static short nextShort() {
        return Short.parseShort(scanner.next());
    }

    public static float nextFloat() {
        return Float.parseFloat(scanner.next());
    }

    public static void printYes() {
        System.out.println("Yes");
    }

    public static void printYES() {
        System.out.println("YES");
    }

    public static void printNo() {
        System.out.println("No");
    }

    public static void printNO() {
        System.out.println("NO");
    }

    public static String nextLine() {
        return scanner.nextLine();
    }

    public static double distance(double x, double y, double x2, double y2) {
        return Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y));
    }

    public static int MOD = 1_000_000_007;
    public static int MAX = 100000;
    public static long[] fac = new long[MAX];
    public static long[] finv = new long[MAX];
    public static long[] inv = new long[MAX];

    public static void combinit() {
        fac[0] = fac[1] = 1;
        finv[0] = finv[1] = 1;
        inv[1] = 1;
        for (int i = 2; i < MAX; i++) {
            fac[i] = fac[i - 1] * i % MOD;
            inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
            finv[i] = finv[i - 1] * inv[i] % MOD;
        }
    }

    public static long combination(int n, int k) {
        if (n < k || n < 0 || k < 0) return 0;
        return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
    }

    public static long factorial(long n) {
        return n <= 0 ? 1 : n * factorial(n - 1);
    }
}

Measured memory_bytes: 29412
import java.util.*;

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

        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        int c = stdIn.nextInt();
        int d = stdIn.nextInt();

        int lower = Math.max(a, c);
        int upper = Math.min(b, d);
        
        System.out.println(Math.max(0, upper - lower));

    }
}


Measured memory_bytes: 21844
#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 10000000007; //10^9+7

int main(){
  string s;
  cin>>s;
  s[3]='8';
  print(s);
}

Measured memory_bytes: 256
// AOJ 2313 Box Witch
// 2018.3.15 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

// AOJ 2118 Oil Company
// 2018.3.10 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*******************************************/
/* Dinic's Max Flow Algorithm 
/*******************************************/

#define INF 0x01010101
#define VMAX 505
typedef struct { int to, cap, rev; char run; } EDGE;
EDGE edge[VMAX][VMAX]; int hi[VMAX];
int V, source, sink;
char used[VMAX];

void add_edge(int from, int to, int cap)
{
	int f, t;
	EDGE *e;

	f = hi[from]++, t = hi[to]++;
	e = &edge[from][f], e->to = to, e->cap = cap, e->rev = t, e->run = 1; 
	e = &edge[to][t], e->to = from, e->cap = cap, e->rev = f, e->run = 1;
}

int dfs(int v, int t, int f)
{
	int i, d;
	EDGE *e;
	
	if (v == t) return f;
	used[v] = 1;
	for (i = 0; i < hi[v]; i++) {
		e = &edge[v][i];
		if (e->run == 0) continue;
		if (e->cap > 0 && !used[e->to]) {
			d = dfs(e->to, t, f <= e->cap? f: e->cap);
			if (d > 0) {
				e->cap -= d;
				edge[e->to][e->rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}

int maxFlow(int s, int t, int max)
{
	int f, flow = 0;
	while (max > 0) {
		memset(used, 0, V);
		f = dfs(s, t, max);
		if (!f) break;
		flow += f;
		max -= f;
	}
	return flow;
}

int back_edge(int from, int to)
{
	int i;
	EDGE *e;

	for (i = 0; i < hi[from]; i++) if (edge[from][i].to == to) {
		e = &edge[from][i];
		if (e->run) {
			e->run = 0;
			if (e->cap == 0 && maxFlow(from, to, 1) == 0) {
				maxFlow(from, source, 1);
				maxFlow(sink, to, 1);
				break;
			}
			return 0;
		}
	}
	return 1;
}

/**********************************************/


#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int main()
{
	int N, E, Q, i, ans;

	N = in(), E = in(), Q = in();
	
	source = 0, sink = N-1, V = sink+1;
	for (i = 0; i < E; i++) {
		int f = in()-1, t = in()-1;
		add_edge(f, t, 1);
	}

	ans = maxFlow(source, sink, INF);

	while (Q--) {
		int m = in(), a = in()-1, b = in()-1;
		if (m == 1) {
			add_edge(a, b, 1);
			ans += maxFlow(source, sink, 1);
		} else {
			ans -= back_edge(a, b);
			ans -= back_edge(b, a);
		}
		printf("%d\n", ans);
	}
	return 0;
}


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

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	bool flag = false;
	for (int i = 1; i <= 9; i++) for (int j = 1; j <= 9; j++) {
		if (i * j == N) flag = true;
	}
	cout << (flag ? "Yes" : "No") << "\n";
	return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;

import static java.lang.System.*;


public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(in.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        HashMap<Integer, Integer> A = new HashMap<>();
        HashSet<Integer> solved = new HashSet<>();

        for (int i = 1; i <= N; i++) {
            A.put(i, 0);
        }

        int ac = 0;
        int penalties = 0;
        for (int i = 0; i < M; i++) {
            st = new StringTokenizer(in.readLine());
            int p = Integer.parseInt(st.nextToken());
            String v = st.nextToken();
            if (v.equals("AC") && !solved.contains(p)) {
              ac ++;
              penalties += A.getOrDefault(p, 0);
              solved.add(p);
            } else {
                A.put(p, A.get(p) + 1);
            }
        }
        out.println(ac + " " + penalties);
    }

}


Measured memory_bytes: 52284
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner scn=new Scanner(System.in);
        int day=scn.nextInt();
        String text="";
        switch(day){
            case 22:
                text="Christmas Eve Eve Eve";
                break;
            case 23:
                text="Christmas Eve Eve";
                break;
            case 24:
                text="Christmas Eve";
                break;
            case 25:
                text="Christmas";
        }
        System.out.println(text);
    }
}

Measured memory_bytes: 23764
H,W = (int(i) for i in input().split())

a = []
for i in range(H):
    tmpinput = input()
    tmp = []
    for j in range(W):
        tmp.append(tmpinput[j])
    a.append(tmp)

yoko = []
for i in range(H):
    shiro = True
    for j in range(W):
        if a[i][j] != ".":
            shiro = False
    if shiro:
        yoko.append(i)

tate = []
for i in range(W):
    shiro = True
    for j in range(H):
        if a[j][i] != ".":
            shiro = False
    if shiro:
        tate.append(i)

for i in range(H):
    tmp = ""
    for j in range(W):
        if (j not in tate) and (i not in yoko):
            tmp = tmp + a[i][j]
    if tmp != "":
        print(tmp)

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

typedef long long int ll;

int main(){
  ll n;
  cin >> n;
  string res = "";
  n--;
  do {
    res += (char)((n % (26)) + 'a');
    n /= 26;
    n--;
  }while(n >= 0);
  reverse(res.begin(), res.end());
  cout << res << endl;
  return 0;
}


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

int main() {
  ll h, ans = 0, numOfMonstars = 1;
  cin >> h;
  while (h / 2)
  {
      h /= 2;
      ans += numOfMonstars;
      numOfMonstars *= 2;
  }
  ans += numOfMonstars;
  cout << ans;
  return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;

const int INF = 1e9;
const ld EPS = 1e-8;

int main(){
  int N, M, X, Y;
  cin >> N >> M >> X >> Y;
  vector<int> x(N), y(M);
  REP(i,N) cin >> x[i];
  REP(i,M) cin >> y[i];

  int xmax = *max_element(x.begin(), x.end());
  int ymin = *min_element(y.begin(), y.end());

  string ret = "War";
  if(max(X, xmax) < min(Y, ymin)) ret = "No War";
  cout << ret << 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 k=sc.nextInt();
    Integer h[] = new Integer[n];
    for(int i=0;i<n;i++){
      h[i]=sc.nextInt();
    }
    Arrays.sort(h);
    long ans=0;
    if(k<n){
      for(int i=0;i<n-k;i++){
        ans+=h[i];
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 63156
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
R = 10**9+7
DBG = True  and False
def ddprint(x):
  if DBG:
    print(x)

def exgcd(x,y):
    if y == 0:
        return (x,1,0)
    else:
        g,b,a = exgcd(y, x%y)
        return (g, a, b-(x//y)*a)

# return y s.t. x*y mod p == 1
def modinv(x,p):
    g,a,b = exgcd(x,p)  # ax+bp = g, g=1 if mutually prime
    return a%p

def comb(p,q):
    if q==0 or q==p:
        return 1
    if q > p-q:
        q = p-q
    num = p
    den = q
    for i in range(1,q):
        num = (num * (p-i))%R
        den = (den * (q-i))%R
    xden = modinv(den,R)
    return (num*xden)%R

n,m,k = inm()
x = ( (n*n*(m-1)*m*(m+1)+m*m*(n-1)*n*(n+1))//6 )%R
y = comb(n*m-2,k-2)
ddprint(x)
ddprint(y)
print((x*y)%R)


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

int main() {
  int n;
  cin >> n;
  vector<int> x(n);
  rep(i,n) cin >> x[i];
  int ans = 1001001001;
  for (int p = 1; p <= 100; ++p) {
    int now = 0;
    rep(i,n) now += (x[i]-p)*(x[i]-p);
    ans = min(ans, now);
  }
  cout << ans << endl;
  return 0;
}

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



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

bool check(string s){
	if(s.size()%2 == 1) return false;

	int middle = s.size()/2;
	if(s.substr(0,middle) == s.substr(middle,middle)) return true;
	else return false;
}


int main(void){

	string s; cin >> s;


	for(int i=s.size()-1;i>=0;--i){
		bool flag = check(s.substr(0,i));
		if(flag == true){ 
			cout << s.substr(0,i).size() << endl;
			return 0;
		}

	}



	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
using namespace std;
vector<pair<int, int>> G[100005];
int ans[100005];
void dfs(int v, int p = -1, int color = 0){
    ans[v] = color;
    for(auto e:G[v]){
        if(e.first == p)
            continue;
        if(e.second %2 == 0)
            dfs(e.first, v, color);
        else
            dfs(e.first, v, 1 - color);//異なる色
    }
}
int main(){
    int n;
    cin >> n;
    rep(i,n-1){
        int u,v,w;
        cin >> u >> v >> w;
        u--;
        v--;
        G[u].push_back({v, w});
        G[v].push_back({u, w});
    }
    dfs(0);//0を根とする
    rep(i, n) cout << ans[i] << endl;
}

Measured memory_bytes: 9088
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int arr[5];
  	int res=0;
  	for(int i=0;i<5;i++)
    {	
      cin>>arr[i];
      if(arr[i]==0)
      {
       res=i+1; 
      }
    }
  cout<<res<<endl;

 }

Measured memory_bytes: 3628
#include <stdio.h>
#include <math.h>
int main()
{
  int n;
  double x,y,dx,dy,l;
  for(;;){
    scanf("%d",&n);
    if(n==-1) break;
    x = 1.0, y = 0.0;
    while(n-- > 1){
      dx = -y; dy = x;
      l = sqrt(dx * dx + dy * dy);
      dx /= l;
      dy /= l;
      x += dx;
      y += dy;
    }
    printf("%.2lf\n%.2lf\n",x,y);
  }
  return 0;
}

Measured memory_bytes: 640
N,L=map(int,input().split())
ans=0
temp=10**9
A=sum([L+i for i in range(N)])
for i in range(N):
    B=0
    for j in range(N):
        if j!=i:
            B+=L+j
    if temp>=abs(A-B):
        ans=B
        temp=abs(A-B)
print(ans)


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


int main(){
   string s;
   cin>>s;
  int n;
  int count=0;
for(int i=0;i<s.size();i++){if(s[i]=='p'){count+=1;}}
  n=s.size()/2;
  cout<<n-count<<endl;
 
    
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define ROOP() while (true)

int gcd(int a, int b){
	if(a == 0 || b == 0) return 1;
	int r;
    while ((r=a%b)){
        a = b;
        b = r;
    }
    return b;
}

int main(){
    
	int N,K;
	cin >> N >> K;
	int x[3000],y[3000];
	for(int i=0; i<N; i++){
		cin >> x[i] >> y[i];
	}
	
	for(int i=0; i<N; i++){
        map<pair<int,int> ,int> tmp;
		for(int j=i+1; j<N; j++){
			int x2 = x[j]-x[i];
			int y2 = y[j]-y[i];
            int x3,y3;
            if(x2 >= 0) x3 = 1;
            else x3 = -1;
            if(y2 >= 0) y3 = 1;
            else y3 = -1;
            
            x2 = abs(x2);
            y2 = abs(y2);
			int g = gcd(x2,y2);
			x2 = x2 / g * x3;
			y2 = y2 / g * y3;
			if(x2 == 0) y2 = 1;
			if(y2 == 0) x2 = 1;

            if(tmp.count(make_pair(x2,y2)) == 0) tmp[make_pair(x2,y2)] = 1;
			tmp[make_pair(x2,y2)]++;
			if(tmp[make_pair(x2,y2)] >= K){
				cout << 1 << endl;
				return 0;
			}
		}
	}
	cout << 0 << endl;
    
    return 0;
}


Measured memory_bytes: 3304
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
/////////////////// TYPES & MACROS ///////////////////////////////
#define INFLL 0x3fffffffffffffffLL
#define INF 0x7fffffff
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define all(x) x.begin(),x.end()
#define exist(s,e) (s.find(e)!=s.end())
#define ff first
#define ss second
#define EPS 1e-8
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>ordered_set;
const ll MOD=1000000007;
/////////////////// DEBUG MODE ///////////////////////////////////
#define D(x) cerr<<"DEBUG: "<<#x<<" is: "<<x<<'\n'
#define error(args...) {string _s=#args; replace(all(_s),',',' ');\
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);}
void err(istream_iterator<string>) { cout<<endl;}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
/////////////////// GLOBAL VARIABLES /////////////////////////////
vector<vector<int>> adj; vector<bool> vis;
/////////////////// FUNCTIONS ////////////////////////////////////
template<class T>
T maxx(T a, T b) {return a>b?a:b;}
template<typename T, typename... Args>
T maxx(T a, T b, Args... args){return maxx(a>b?a:b, args...);}
ll mexp(ll x, ll n, ll m){
  ll res=1;  while(n){if(n&1) res=(res*x)%m;n>>=1; x=((x%m)*(x%m))%m;}
  return res;
}
template<class T>
T minn(T a, T b) {return a<b?a:b;}
template<typename T, typename... Args>
T minn(T a, T b, Args... args){return minn(a>b?a:b, args...);}
bool ispow2(ll x){ return x && (!(x&(x-1))); }
ld pow(ld a, int n) {
  if(n == 0) return 1;if(n == 1) return a;
  double t = pow(a, n/2);return t * t * pow(a, n%2);
}
/////////////////// MAIN STARTS //////////////////////////////////
int main(){
  ios::sync_with_stdio(0);  cin.tie(0);   cout<<fixed; cerr<<fixed;
  cout<<setprecision(14); cerr<<setprecision(3);
  #ifdef DEBUG
  freopen("ip.txt","r",stdin); //freopen("op.txt","w",stdout);
  clock_t tStart = clock();
  #endif

	char v[3][3]; string s;
	for(int i=0;i<3;++i){
		for(int j=0;j<3;++j) cin>>v[i][j];
		s+=v[i][i];
	}
	cout<<s<<'\n';

	#ifdef DEBUG
	cerr<<"\nExecution time: "<<(((double)clock() - tStart)/CLOCKS_PER_SEC)*1e3<<"ms.\n";
	#endif
  return 0;
}


Measured memory_bytes: 764
<?php
list($A, $B, $Q) = array_map("intval", explode(" ", trim(fgets(STDIN))));

$aArray[] =-10**18;
for($i = 0; $i < $A; $i++)$aArray[] = intval(fgets(STDIN));
$aArray[] = 10**18;

$bArray[] =-10**18;
for($i = 0; $i < $B; $i++)$bArray[] = intval(fgets(STDIN));
$bArray[] = 10**18;
 
for($i = 0; $i < $Q; $i++){
    $q = intval(fgets(STDIN));
    $min = 10**18;
    $a = bsl($aArray, $q);
    $b = bsl($bArray, $q);
    foreach([[[$aArray, $a], [$bArray,$b]], [[$bArray, $b], [$aArray,$a]]] as list(list($aa, $_a), list($bb, $_b))){
        foreach([$aa[$_a], $aa[$_a+1]] as $a1){
            $p3 = $bb[$_b]??10**12;
            $p4 = $bb[$_b+1]??10**12;
            $min = min($min, abs($q - $a1) + abs($a1 - $p3));
            $min = min($min, abs($q - $a1) + abs($a1 - $p4));
        }
    }
    printf("%d\n", $min);
}
 
//二分探索　target以下で最大の値の場所を返す
function bsl($nums, $target) {
    $size = count($nums);
    $min = 0; 
    $max = $size - 1;
    while(true){
        $center = intdiv($min + $max, 2);
        $centerValue = $nums[$center];
        if($target == $centerValue){
            return $center;
        }elseif($target > $centerValue){
            $min = $center + 1;
        }else{
            $max = $center;
        }
        if($min == $max){
            $center = intdiv($min + $max, 2);
            $centerValue = $nums[$center];
            if($centerValue == $target){
                return $center;
            }elseif($centerValue < $target){
                return $center;
            }else{
                return $center - 1;
            }
        }
    }
}

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

int main() {
	int n, emax = 0, omax = 0, om, em;
	vector<int>o(100001, 0); vector<int>e(100001, 0);
	cin >> n;

	for (int i = 0, a, b; i < n / 2; i++) {
		cin >> a >> b;
		o[b]++; e[a]++;
		if (o[b] > omax) { omax = o[b]; om = b; }
		if (e[a] > emax) { emax = e[a]; em = a; }
	}
	sort(o.rbegin(), o.rend()); sort(e.rbegin(), e.rend());

	if (om != em)cout << n - o[0] - e[0] << endl;
	else cout << min(n - o[1] - e[0], n - o[0] - e[1]) << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>

int main() {
  while (1) {
    int N, A, B, C, X;
    scanf("%d %d %d %d %d", &N, &A, &B, &C, &X);
    if (N == 0 && A == 0 && B == 0 && C == 0 && X == 0) break;
    int Y[100];
    for (int i = 0; i < N; i++) scanf("%d", &Y[i]);
    int stopped = 0, frames = -1;
    for (int i = 0; i <= 10000; i++) {
      if (X == Y[stopped]) {
        stopped++;
        if (stopped == N) frames = i;
      }
      X = (A * X + B) % C;
    }
    printf("%d\n", frames);
  }
}



Measured memory_bytes: 2036
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
using namespace std;
const double INF = 1LL<<60;

double calc(double cur, double next, double h) {
    if ((cur-h) * (next-h) >= 0) {
        return (abs(cur-h) + abs(next-h)) / 2;
    }
    else {
        double a = abs(cur - h), b = abs(next - h);
        return (a*a + b*b) / (a + b) / 2;
    }
}

int main() {
    int N; cin >> N;
    vector<double> H(N);
    for (int i = 0; i < N; ++i) cin >> H[i];

    vector<vector<double> > dp(N+1, vector<double>(300, INF));
    dp[0][1] = 0;
    for (int i = 0; i < N; ++i) {
        for (int h = 1; h < 300; ++h) {
            for (int h2 = 1; h2 < 300; ++h2) {
                dp[i+1][h2] = min(dp[i+1][h2], dp[i][h] + calc(h, h2, H[i]));
            }
        }
    }
    double res = INF;
    for (int h = 1; h < 300; ++h) res = min(res, dp[N][h]);
    cout << fixed << setprecision(10) << res << endl;
}



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

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

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

const int MAX = 1e5 + 5;
const int INF = 1001001001;
const int MOD = 1e9 + 7;

int bfs(int s, vector<vector<int>>& G) {
    int N = G.size();
    vector<int> vis(N, 0);
    queue<int> q;
    q.push(s);
    vis[s] = 1;

    int res = 1;
    while (!q.empty()) {
        int n = q.front(); q.pop();
        for (int next : G[n]) {
            if (vis[next] == 0) {
                q.push(next);
                vis[next] = vis[n] + 1;
                res = max(res, vis[next]);
            } else if (vis[next] != vis[n] - 1 && vis[next] != vis[n] + 1) {
                return -1;
            }
        }
    }

    return res;
}

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

    vector<vector<int>> G(N, vector<int>());
    rep(i, N) {
        string s;
        cin >> s;
        rep(j, N) {
            if (s[j] == '1') G[i].push_back(j);
        }
    }

    int ans = 0;
    rep(i, N) {
        int res = bfs(i, G);
        if (res < 0) {
            puts("-1");
            return 0;
        }
        ans = max(ans, res);
    }

    cout << ans << endl;
}

Measured memory_bytes: 512
#include <stdio.h>

int main(void)
{
  char num[5];
  scanf("%s", num);
  
  for (int i = 0; i < 3; i++)
  {
    if (num[i] == '7')
    {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}


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

//k<=3より
ll comb(ll n, ll r){
    if(r==1) return n;
    else if(r==2) return n*(n-1)/2;
    else return n*(n-1)*(n-2)/6;
}

ll pow(ll n, ll k){
    ll res = 1;
    rep(i,k) res*= n;
    return res;
}

ll solve(ll i, ll k, ll smaller){
    if(i==n){
        if(k==0) return 1;
        else return 0;
    }
    if(k==0) return 1;

    if(smaller) return comb(n-i,k) * pow(9,k);
    else{
        if(s[i]=='0') return solve(i+1,k,false);
        else{
            ll zero = solve(i+1,k,true);
            ll aida = solve(i+1,k-1,true)*(s[i]-'1');
            ll same = solve(i+1,k-1,false);
            return zero + aida + same;
        }
    }
}

int main(){
    cin>>s>>k;
    n = s.size();
    cout << solve(0,k,false) << endl;
}

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

#include <cmath>
#include <iomanip>

void _126() {
    int n, k;
    cin >> n >> k;

    double probability = 0.0;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; ; ++j) {
            if (i * pow(2, j) >= k) {
                probability += (pow(0.5, j)) / n;
                break;
            }
        }
    }
    cout << fixed << setprecision(12);
    cout << probability << endl;
}

void _127() {
    int n, m, limit_l, limit_r, l, r;
    cin >> n >> m;
    limit_l = 1;
    limit_r = n;
    for (int i = 0; i < m; ++i) {
        cin >> l >> r;
        if (l > limit_l) {
            limit_l = l;
        }
        if (r < limit_r) {
            limit_r = r;
        }
    }
    int count = max(limit_r - limit_l + 1, 0);
    cout << count << endl;
}

int main()
{
    _127();
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
  #define f(i,a,b) for(int i=a;i<b;i++)
  #define ll long long
  #define vll vector<long long>
  #define mll map<ll,ll>
  #define pll pair<long long,long long>
  #define pb(x) push_back(x)
  #define F first
  #define S second
  #define print(v) for(auto it:v)cout<<it<<" "
  #define mod 1000000007   //10^9 +7
  #define sorty(v) sort(v.begin(),v.end())
  #define it(v) v.begin(),v.end()
using namespace std;  

int main() {
  string s;
  int flag=0;
  cin>>s;
  for(int i=1;i<3;i++){
    if(s[i]!=s[i-1])flag=1;
  }
  if(flag==1)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;



	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;

int main(){
	string S,T;
	cin>>S>>T;
	if(S[0]==T[2] && S[1]==T[1] && S[2]==T[0]) cout<<"YES";
	else cout<<"NO";
}

Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=input.trim().split("\n");
Arr.shift();
Arr.forEach(function(v){
   var ans=[];
   var arr=v.split("");
   var t=-1;
   for(var i=0;i<arr.length;i++){
      if(arr[i]=="c")t=0;
      ans.push(t);
      if(t!=-1)t++;
   }
   console.log(ans.join(" "));
});

Measured memory_bytes: 9572
#include <stdio.h>

int main(void){
    int a,b,s,d;

    while(scanf("%d %d",&a,&b)!=EOF){
        s=a+b;
        d=0;
        while(s>0){
            d++;
            s/=10;
        }
        printf("%d\n",d);
    }

    return 0;
}

Measured memory_bytes: 600
import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		char[][] s=new char[h][];
		for(int i=0;i<h;i++){
			s[i]=sc.next().toCharArray();
		}
		
		int[][] r=new int[h][w];

		//r//
		char test;
		r[0][w-1]=0;
		for(int i=0;i<h;i++){
			for(int j=w-1;j>=0;j--){
				test=s[i][j];
				//System.out.println(test);//	
				if(j==w-1){
					if(test=='#'){
						r[i][j]=0;
					}else if(test=='.'){
						r[i][j]=1;
					}
				}else{
					if(test=='#'){
						r[i][j]=0;
					}else if(test=='.'){
						r[i][j]=r[i][j+1]+1;
					}
				}
			}
		}

		//l//
		
		int[][] l=new int[h][w];
		l[0][0]=0;
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				test=s[i][j];
				//System.out.println(test);//	
				if(j==0){
					if(test=='#'){
						l[i][j]=0;
					}else if(test=='.'){
						l[i][j]=1;
					}
				}else{
					if(test=='#'){
						l[i][j]=0;
					}else if(test=='.'){
						l[i][j]=l[i][j-1]+1;
					}
				}
			}
		}

		//u//
		int[][] u=new int[h][w];
		u[0][0]=0;
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				test=s[i][j];
				//System.out.println(test);//	
				if(i==0){
					if(test=='#'){
						u[i][j]=0;
					}else if(test=='.'){
						u[i][j]=1;
					}
				}else{
					if(test=='#'){
						u[i][j]=0;
					}else if(test=='.'){
						u[i][j]=u[i-1][j]+1;
					}
				}
			}
		}

		//d//
		int[][] d=new int[h][w];
		d[h-1][0]=0;

		for(int i=h-1;i>=0;i--){
			for(int j=0;j<w;j++){
				test=s[i][j];
				//System.out.println(test);//	
				if(i==h-1){
					if(test=='#'){
						d[i][j]=0;
					}else if(test=='.'){
						d[i][j]=1;
					}
				}else{
					if(test=='#'){
						d[i][j]=0;
					}else if(test=='.'){
						d[i][j]=d[i+1][j]+1;
					}
				}
			}
		}

		int max=0;
		int p;
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				p=r[i][j]+l[i][j]+u[i][j]+d[i][j]-3;
				if(p>max)
					max=p;
			}
		}
		System.out.println(max);
	}
}

Measured memory_bytes: 111696
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

enum direction{
  UP    = 0,
  RIGHT = 1,
  DOWN  = 2,
  LEFT  = 3
};

/*
 *   6
 *   2
 * 3 1 4
 *   5
 */

/* top and RIGHT */
int next_top[7][7][4];
int next_left[7][7][4];
int front[7][7];

void initDie(){
  front[1][3] = 2; front[1][2] = 4; front[1][4] = 5; front[1][5] = 3;
  front[2][1] = 3; front[2][3] = 6; front[2][4] = 1; front[2][6] = 4;
  front[3][1] = 5; front[3][2] = 1; front[3][5] = 6; front[3][6] = 2;
  for(int i = 4; i < 7; i++){
    for(int j = 1; j < 7; j++){
      if(i == j || i + j == 7) continue;
      int t = 7 - i;
      int l = 7 - j;
      front[i][j] = front[t][l];
    }
  }

  for(int t = 1; t < 7; t++){
    for(int l = 1; l < 7; l++){
      if(t == l || t + l == 7) continue;

      next_top[t][l][UP]     = 7 - front[t][l];
      next_top[t][l][LEFT]   = 7 - l;
      next_top[t][l][RIGHT]  = l;
      next_top[t][l][DOWN]   = front[t][l];

      next_left[t][l][UP]    = l;
      next_left[t][l][LEFT]  = t;
      next_left[t][l][RIGHT] = 7 - t;
      next_left[t][l][DOWN]  = l;
    }
  }
}

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int main(){
  int n;
  int m[128]; m['n'] = UP;  m['e'] = RIGHT;  m['s'] = DOWN;  m['w'] = LEFT;

  initDie();

  while(scanf("%d ", &n), n){
    int top  = 1;
    int left = 3;

    REP(i,n){
      char buff[64];
      scanf("%s ",buff);
      int direct = m[buff[0]];
      int tt = top;
      int ll = left;
      top  = next_top[tt][ll][direct];
      left = next_left[tt][ll][direct];
      //printf("%s: %d %d\n",buff,top,left);
    }

    print(top);
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long n, ans=0, i;
    map<long long, long long> mp;
    cin >> n;
    for(i=0;i<n;i++){
        long long a;
        cin >> a;
        mp[a]++;
    }

    for(auto x : mp){
        if(x.second%2!=0) ans++;
    }
    
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 9732
#include <iostream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <unordered_set>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <cstdint>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

constexpr ll inf = INT64_MAX / 4;
constexpr double pi = asin(1) * 2;
constexpr ll mod = 1000000007;

int main() {
    ll h, w;
    cin >> h >> w;
    if (h == 1 || w == 1) cout << 1 << endl;
    else cout << (h * w + 1) / 2 << endl;
}

Measured memory_bytes: 256