akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
 
using namespace std;
 
const int maxn=1e5+500;
 
long long gcd(long long x,long long y)
{
    while(x!=y)
    {
        if(x>y) x=x-y;
        else
            y=y-x;
    }
    return x;
}
 
int main()
{
	long long n,m;
	cin>>n>>m;
	string s,t;
	cin>>s>>t;
	long long b=n/gcd(n,m)*m;
	long long bb=gcd(n,m);
	int flag=1;
	long long time1=b/m,time2=b/n;
	for(int i=0;i<(int)max(n,m);i++){
		if(s[time1*i%n]!=t[time2*i%m]){
			flag=0;
			break;
		}
	}
	cout<<(flag? b:-1);
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define pb push_back
#include <string> 
using namespace std;
const int N = 1000000;
int n, a[N];

void solve(){
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	for(int i = 0; i < n; i++){
		int l = 2 * i + 1, r = 2 * i + 2, pa = (i - 1) / 2;
		string s = "node " + to_string(i + 1) + ": ";
		s += "key = " + to_string(a[i]) + ", ";
		if(pa >= 0 && pa != i){
			s += "parent key = " + to_string(a[pa]) + ", ";
		}
		if(l < n){
			s += "left key = " + to_string(a[l]) + ", ";
		}
		if(r < n){
			s += "right key = " + to_string(a[r]) + ", ";
		}
		cout << s << endl;
	}
}
int main(void){
	solve();
	return 0;
}


Measured memory_bytes: 3236
#include <iostream>

using namespace std;

int main() {
    int n, m, l;
    cin >> n >> m >> l;

    int a[100][100];
    int b[100][100];
    long long c[100][100];

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

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

    return 0;
}



Measured memory_bytes: 3256
def main():
    lint=int(input())
    l=bin(lint-1)[2:]
    le=len(l)
    if le<20:
        ans=[[1,2,0]]
        if 2**le==lint:
            ans.append([1,2,2**(le-1)])
        for i in range(2,le+1):
            ans.append([i,i+1,0])
            ans.append([i,i+1,2**(le-i)])
        memo=[2**(le-i)-1 for i in range(le)]+[0]
        temp=[]
        cnt=0
        for i in range(le):
            if l[i]=="1":
                cnt+=2**(le-i-1)
                temp.append(cnt)
        for i in range(le-1,-1,-1):
            if l[i]=="1":
                temp.pop()
            else:
                break
        temp+=[10**9]
        cnt=0
        for i in range(le+1):
            if memo[i]+temp[cnt]<lint:
                ans.append([1,i+1,temp[cnt]])
                cnt+=1
        print(le+1,len(ans))
        for i in ans:
            print(*i)
    else:
        ans=[]
        for i in range(2,le+1):
            ans.append([i-1,i,0])
            ans.append([i-1,i,2**(le-i)])
        memo=[2**(le-i)-1 for i in range(le)]+[0]
        temp=[]
        cnt=0
        for i in range(le):
            if l[i]=="1":
                cnt+=2**(le-i-1)
                temp.append(cnt)
        for i in range(le-1,-1,-1):
            if l[i]=="1":
                temp.pop()
            else:
                break
        temp+=[10**9]
        cnt=0
        for i in range(le+1):
            if memo[i]+temp[cnt]<lint:
                ans.append([1,i,temp[cnt]])
                cnt+=1
        print(le,len(ans))
        for i in ans:
            print(*i)
main()

Measured memory_bytes: 3192
#include<bits/stdc++.h>
using namespace std;
int main(){
  string W;
  cin>>W;
  if(W=="Sunny"){
    cout<<"Cloudy"<<endl;
  }
  else if(W=="Cloudy"){
    cout<<"Rainy"<<endl;
  }
  else{
    cout<<"Sunny"<<endl;
  }
}

Measured memory_bytes: 256
// AOJ ITP1_10_C Standard Deviation
// 2018.4.28 bal4u
 
#include <stdio.h>
#include <math.h>
 
int s[1002];
 
#define gc() getchar_unlocked()
int in()
{
    int n = 0, c = gc();
    do n = 10*n + (c & 0xf), c = gc();
    while (c >= '0');
    return n;
}
 
int main()
{
    int n, i, is;
    double m, fs, a;
     
    while (n = in()) {
        is = 0; for (i = 0; i < n; i++) is += s[i] = in();
        m = (double)is/n;
        fs = 0; for (i = 0; i < n; i++) {
            a = s[i]-m;
            fs += a*a;
        }
        printf("%.8lf\n", sqrt(fs/n));
    }
    return 0;
}


Measured memory_bytes: 2144
# input
N = int(input())
A = [int(i) for i in input().split()]

# main
x = sum(A) - 2*sum([A[i] for i in range(1, N, 2)])
water = [x]

for i in range(N - 1):
  x = 2*A[i] - x
  water.append(x)
  # print("new water: ", water)

# output
print(*water)

Measured memory_bytes: 14092
n = int(input())
testimony = []  # 各iの証言
 

# 例2 tstimony = [[(1, 1), (2, 0)], [(2, 1), (0, 0)], [(0, 1), (1, 0)]] 
for i in range(n):
    t = []
    for _ in range(int(input())):
        x, y = map(int, input().split())
        t.append((x - 1, y)) 
    testimony.append(t)

max_honest = 0  # 正直者の最大人数

# 例2 ishonest = [False, False, False],[True, False, False],[False, True, False],[True, True, False],[False, False, True],[True, False, True],[False, True, True],[True, True, True]
for i in range(1 << n):
    ishonest = [False] * n
    for j in range(n):
        if ((i >> j) & 1) == 1:
            ishonest[j] = True
    #print(ishonest)

    ok = True

    for k in range(n):
        # False（不親切な人）の証言は気にしない
        if ishonest[k] == False:
            continue
        
        # True（正直者）の証言はチェック
        for l in range(len(testimony[k])):
            person = testimony[k][l][0]
            true_false = testimony[k][l][1]
            
            # Trueのはずやのに証言が0(False)になっている場合はおかしい
            # Falseのはずやのに証言が1(True)になっている場合はおかしい
            if (ishonest[person] == True) and (true_false == 0) or (ishonest[person] == False) and (true_false == 1):
                ok = False

        if ok == False:
            break
        
    if ok == True:

        if ishonest.count(True) > max_honest:
            max_honest = ishonest.count(True)

print(max_honest)

Measured memory_bytes: 3064
package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
	"strings"
)

var words = []string{"dream", "dreamer", "erase", "eraser"}

func main() {
	scanner := makeWordScanner()
	x := eGetInt(scanner)
	y := eGetInt(scanner)
	z := eGetInt(scanner)
	x, y = y, x
	x, z = z, x
	fmt.Println(x, y, z)
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
const (
	TooLarge = math.MaxInt64
	TooSmall = math.MinInt64
)

func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeCharScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanRunes)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetInt64(r *bufio.Scanner) int64 {
	line := eGetLine(r)
	return eAtoInt64(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetInt64s(r *bufio.Scanner) []int64 {
	fields := eGetFields(r)
	ints := make([]int64, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoInt64(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}
func eAtoInt64(s string) int64 {
	n, err := strconv.ParseInt(s, 10, 64)
	if err != nil {
		log.Fatal(err)
	}
	return n
}
func pow(a, n int) int {
	if n == 0 {
		return 1
	}
	if n == 1 {
		return a
	}
	if n%2 == 1 {
		return pow((a*a), n/2) * a
	}
	return pow((a * a), n/2)
}
func powMod(a, n, mod int) int {
	if n == 0 {
		return 1 % mod
	}
	if n == 1 {
		return a % mod
	}
	if n%2 == 1 {
		return powMod((a*a)%mod, n/2, mod) * a % mod
	}
	return powMod((a*a)%mod, n/2, mod)
}

func factoricalMod(n, count, mod int) int {
	if count == 1 {
		return n % mod
	}
	return (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod
}

func combinationMod(n, a, mod int) int {
	x := factoricalMod(n, a, mod)
	y := factoricalMod(a, a, mod)
	y = powMod(y, mod-2, mod)
	return ((x % mod) * (y % mod)) % mod
}
func countBitOfOn(i, numbits int) int {
	count := 0
	var bit uint64
	for bit = 0; bit < uint64(numbits); bit++ {
		t := 1 << bit
		if i&t > 0 {
			count++
		}
	}
	return count
}

type ints []int

func ToString(slice []int) string {
	format := fmt.Sprint(slice)
	return fmt.Sprint(format[1 : len(format)-1])
}


Measured memory_bytes: 640
#include <string>
#include <sstream>
#include <iostream>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

using namespace std;
typedef pair<int ,int > P;

struct Node {
    int value;
    Node *next;
    Node *prev;
};
Node *nil;

void init() {
    nil = new Node();
    nil->next = nil;
    nil->prev = nil;
}

void insert_node(int x) {
    Node *p = new Node;
    p->value = x;

    p->next = nil->next;
    nil->next->prev=p;
    nil->next=p;
    p->prev=nil;
}

Node* search_node(int x) {
    Node *cur = nil->next;
    while(cur != nil && cur->value != x) cur = cur->next;
    return cur;
}

void delete_node(Node *p) {
    if(p == nil) return;
    p->prev->next=p->next;
    p->next->prev=p->prev;
    delete p;
}
void delete_first_node() {
    delete_node(nil->next);
}
void delete_last_node() {
    delete_node(nil->prev);
}
void delete_key_node(int x) {
    delete_node(search_node(x));
}

int main() {
    ios::sync_with_stdio(false);
    init();
    int n;
    string q;
    cin>>n;
    while(n--) {
        int x;
        cin>>q;
        if(q=="insert") {
            cin>>x;
            insert_node(x);
        }
        else if(q=="delete") {
            cin>>x;
            delete_key_node(x);
        }
        else if(q=="deleteFirst") {
            delete_first_node();
        }
        else if(q=="deleteLast") {
            delete_last_node();
        }
    }
    int t=0;
    Node *cur = nil->next;
    while(cur != nil) {
        if(t++) cout<<" ";
        cout<<cur->value;
        cur=cur->next;
    }
    cout<<endl;
    
    return 0;
}

Measured memory_bytes: 34412
# vim: fileencoding=utf-8


def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = 1
    flg = 0
    cursol = 0
    for i in a:
        if cursol == 0:
            cursol = i
            continue
        if flg == 0:
            if i > cursol:
                flg = 1
                cursol = i
            elif i < cursol:
                flg = -1
                cursol = i
        elif flg == 1:
            if i >= cursol:
                cursol = i
            elif i < cursol:
                cursol = i
                flg = 0
                ans += 1
        else:
            if i <= cursol:
                cursol = i
            elif i > cursol:
                cursol = i
                flg = 0
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 84464
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MX = 2e5 + 100;
int v[MX], mn[MX], nxt[MX], ptr[MX], pass[MX];
void dfs(int p, int t, int k, int n) {
    if(pass[p] and t < k) {
        t += (k - t) / (t - pass[p]) * (t - pass[p]);
        memset(pass, 0, sizeof(pass));
    }
    pass[p] = t;
    if(t >  k) return;
    if(t == k) {
        vector<int> que; set<int> s;
        for(int i = p; i < n; i ++) {
            if(s.count(v[i])) {
                while(s.count(v[i])) s.erase(que.back()), que.pop_back();
            }
            else que.push_back(v[i]), s.insert(v[i]);
        }
        for(auto it: que) cout << it << ' ';
        return;
    }
    if(ptr[p] == p and p == n - 1) dfs((ptr[p] + 1) % n, t + 2, k, n);
    else                           dfs((ptr[p] + 1) % n, t + 1, k, n);
}
main() {
    for(int i = 0; i < MX; i ++) mn[i] = MX;
    int n, k; cin >> n >> k;
    for(int i = 0; i < n; i ++) cin >> v[i];
    for(int i = 0; i < n; i ++) mn[v[i]] = min(mn[v[i]], i);
    for(int i = n - 1; i >= 0; i --) {
        if(nxt[v[i]]) ptr[i] = nxt[v[i]];
        else          ptr[i] = mn [v[i]];
        if((ptr[i] + 1) % n > i and ptr[i] != i) ptr[i] = ptr[(ptr[i] + 1) % n];
        nxt[v[i]] = i;
    }
    dfs(0, 1, k, n);
}

Measured memory_bytes: 66676
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
#define PAU system("pause")

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vb> vvb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 28);
const ll LINF = 1e18;
const double PI = acos(-1);

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, K;
	cin >> N >> K;
	if ((N + 1) / 2 >= K)cout << "YES" << endl;
	else cout << "NO" << endl;
	PAU;
	return 0;
}


Measured memory_bytes: 504
import sys
import bisect as bi
import math
from collections import defaultdict as dd
input=sys.stdin.readline
##sys.setrecursionlimit(10**7)
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
for _ in range(1):
    s=input().strip()
    n=len(s)
    ans=0
    if('R' in s):
        p=s.index('R');
        c=1
        for i in range(p+1,n):
            if(s[i]=='R'):
                c+=1
            else:
                ans=max(ans,c)
                c=0
        ans=max(ans,c)
    print(ans)
        
        


Measured memory_bytes: 9344
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int n,d;
int main(){
	while(cin>>n,n){
		int Wh =0;
		int Hh = 0;
		int Wl =1000000;
		int Hl =1000000;
		int x[n];
		int y[n];
		x[0] = 0;
		y[0] = 0;
		for(int i =1;i < n;i++){
			int num;
			cin>>num>>d;
			if(d==0){
				x[i] =x[num] +dx[2];
				y[i] =y[num] +dy[2];
			}else if(d ==1){
				x[i] =x[num] +dx[3];
				y[i] =y[num] +dy[3];
			}else if(d==2){
				x[i] =x[num] +dx[0];
				y[i] =y[num] +dy[0];
			}else if(d==3){
				x[i] =x[num] +dx[1];
				y[i] =y[num] +dy[1];
			}
		}
		for(int i = 0;i < n;i++){
			Wh =max(Wh,x[i]);
			Hh =max(Hh,y[i]);
			Wl =min(Wl,x[i]);
			Hl =min(Hl,y[i]);
		}
		cout <<Wh-Wl+1<<" "<<Hh-Hl+1<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using Atcoder.AtCoderBeginnerContest101.Questions;
using Atcoder.AtCoderBeginnerContest101.Extensions;

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

namespace Atcoder.AtCoderBeginnerContest101.Questions
{
    // ここにQuestionクラスをコピペ
    public class QuestionB : AtCoderQuestionBase
    {
        public override string Solve(TextReader inputStream)
        {
            var n = inputStream.ReadLong();

            if (n % S(n) == 0)
            {
                return "Yes";
            }
            else
            {
                return "No";
            }
        }

        long S(long n)
        {
            long sum = 0;
            while (n != 0)
            {
                sum += n % 10;
                n /= 10;
            }

            return sum;
        }
    }


    #region Base Classes

    public interface IAtCoderQuestion
    {
        string Solve(string input);
        string Solve(TextReader inputStream);
    }

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

            return Solve(reader);
        }

        public abstract string Solve(TextReader inputStream);
    }

    #endregion
}

#region Extensions

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

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

#endregion

Measured memory_bytes: 13140
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
  ll modpow(ll x, ll b){
    ll res = 1;
    while(b){
      if(b&1)res = res * x % MOD;
      x = x * x % MOD;
      b>>=1;
    }
    return res;
  }

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  void in(t&x){
    cin >> x;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;

int main(){
  int n = in();
  set<int> s;
  rep(i,n)s.emplace(in());
  int q = in();
  rep(_,q){
    cout << s.count(in()) << endl;
  }
}



Measured memory_bytes: 7856
import java.util.* ;
import java.util.Map.Entry;
public class Main {
	
	public static void main(String[] args) {
		Scanner S = new Scanner( System.in ) ;
		int n = S.nextInt() ;
		Long[] arr = new Long[n] ;
		long result = 0 ;
			long aa = 0 ;
		HashMap<Long,Long> map = new HashMap<>() ;
		for( int i=0;i<n;i++ ){
			arr[i] = S.nextLong();
			result += arr[i] ;
			map.put( arr[i] , map.getOrDefault( arr[i] , aa )+1 ) ;
		} 

		int op = S.nextInt() ;
		for( int i=0;i<op;i++ ) {
			long a = S.nextLong() ;
			long b = S.nextLong() ;
			if( map.containsKey(a) ) {
			long value = map.get( a ) ;
			map.remove( a ) ;
			map.put( b , map.getOrDefault( b , aa )+value ) ;
			result = ( result - ( value*a ) ) + ( value*b ) ;
			}	
			System.out.println(  result );
		}
	}
}


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

int main()
{
    int n;
    std::vector<int> d;
    std::cin>>n;
    d.resize(n);
    for(int i=0;i<n;i++)std::cin>>d[i];
    if(n%2==1)std::cout<<0<<std::endl;

    std::sort(d.begin(),d.end());
    int mid = n/2-1;
    std::cout<<d[mid+1]-d[mid]<<std::endl;
}


Measured memory_bytes: 640
#include <algorithm>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

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

	int n, m;
	cin >> n >> m;

	vector<int> s(n), t(n);
	for(int i = 0; i < n; ++i)
		cin >> s[i] >> t[i];

	vector<int> p(m + 1);
	for(int i = 0; i < m; ++i)
		cin >> p[i];

	p[m] = INT_MAX;
	sort(p.begin(), p.end());

	long long ans = 0;
	vector<int> cnt(m + 1, 0);
	for(int i = 0; i < n; ++i) {
		const int l = upper_bound(p.begin(), p.end(), s[i]) - p.begin();
		const int h = upper_bound(p.begin(), p.end(), t[i]) - p.begin();
		if(l < h) {
			ans += p[l] - s[i];
			++cnt[l + 1];
			if((h - l) & 1) {
				--cnt[h];
			}
			else {
				--cnt[h - 1];
				ans += t[i] - p[h - 1];
			}
		}
		else if(l > h) {
			ans += s[i] - p[l - 1];
			--cnt[l - 1];
			if((h - l) & 1) {
				++cnt[h];
			}
			else {
				++cnt[h + 1];
				ans += p[h] - t[i];
			}
		}
		else
			ans += abs(s[i] - t[i]);
	}

	for(int i = 2; i < m - 1; ++i)
		cnt[i] += cnt[i - 2];

	for(int i = 0; i < m - 1; ++i)
		ans += (long long)cnt[i] * (p[i + 1] - p[i]);

	cout << ans << endl;

	return EXIT_SUCCESS;
}

Measured memory_bytes: 2592
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (int i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,x) for (int i = 0; i < x.size(); i++)
#define RREPALL(i,x) for (int i = x.size()-1; i >= 0; i--)
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define MIN_ELEMENT(x) min_element(ALL(x))
#define MAX_ELEMENT(x) max_element(ALL(x))
#define COUNT(x,num) count(ALL(x), num)
#define MEMSET(x,val) memset(x, val, sizeof(x))
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
#define fst first
#define scd second
#define nextline putchar('\n')
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef vector<ll> VLL;
typedef vector<vector<ll>> VVLL;
const int INF = 1e7;
const ll MOD = 1e9 + 7;

VI k{10, 50, 100, 500};
int p;

int main()
{
    bool not_first = false;
    while (cin>>p, p) {
        if (not_first)
            nextline;
        else
            not_first = true;

        VI ans(4,INF);
        int val = INF;
        VI have(4);
        REP(i,4) cin>>have[i];
        REP(n10,have[0]+1) REP(n50,have[1]+1) REP(n100,have[2]+1) REP(n500,have[3]+1) {
            int tdiff = n10 * 10 + n50 * 50 + n100 * 100 + n500 * 500 - p;
            if (tdiff < 0)
                continue;
            int tval = have[0] + have[1] + have[2] + have[3] - n10 - n50 - n100 - n500;
            if (tdiff < 500 || n500 == 0) {
                tval += tdiff / 500;
                tdiff %= 500;
            } else {
                continue;
            }
            if (tdiff < 100 || n100 == 0) {
                tval += tdiff / 100;
                tdiff %= 100;
            } else {
                continue;
            }
            if (tdiff < 50 || n50 == 0) {
                tval += tdiff / 50;
                tdiff %= 50;
            } else {
                continue;
            }
            if (tdiff < 10 || n10 == 0) {
                tval += tdiff / 10;
                tdiff %= 10;
            } else {
                continue;
            }
            if (tval < val)
                ans = {n10, n50, n100, n500};
        }

        REP(i,4) {
            if (ans[i]) cout<<k[i]<<" "<<ans[i]<<endl;
        }
    }

    return 0;
}



Measured memory_bytes: 2996
x = int(input())

if 400<= x <=599:
    print(8)
elif 600 <= x <=799:
    print(7)
elif 800 <= x <=999:
    print(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <=1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
else:
    print(1)

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

int rows, column;
string input [1000];

int main (){
	cin>>rows>>column;
	for (int i=1; i<=rows; i++)
		cin>>input [i];
	for (int i=1; i<=column+2; i++){
		cout<<"#";
	}
	cout<<endl;
	for (int i=1; i<=rows; i++){
		cout<<"#"<<input [i]<<"#"<<endl;
	}
		for (int i=1; i<=column+2; i++){
		cout<<"#";
	}
}

Measured memory_bytes: 3644
integer N
character(5000) S
integer maxlen
integer ans,preans
read*,N
read*,S
ans=0
do i=1,N-1
  do j=i+1,N
    if(S(i:i)==S(j:j))then
      maxlen=min(N-j+1,j-i)
      if(maxlen<=ans)cycle
      preans=1
      do ii=1,maxlen-1
        if(S(i+ii:i+ii)/=S(j+ii:j+ii))exit
        preans=preans+1
      end do
      ans=max(ans,preans)
    endif
  end do
end do
print"(I0)",ans
end

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


int main(){
  string s,t;
  cin >> s >> t;

  rep(i, s.size()){
    if(s[i] != t[i]){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes";
}


Measured memory_bytes: 3624
import java.util.*;
 
public class Main{
	public static final int MAX_N = 400000;
	public static int[] segtree = new int[MAX_N];
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Q = sc.nextInt();
		init();
		int n2 = 1;
		while(n2<N) n2*=2;
		for(int i=0;i<Q;++i){
			switch(sc.nextInt()){
			case 0:
				update(sc.nextInt(),n2,sc.nextInt());
				break;
			case 1:
				System.out.println( query(sc.nextInt(),sc.nextInt()+1,0,0,n2) );
				break;
			}
		}
		return;
	}
	
	public static void init(){
		for(int i=0;i<MAX_N;++i) segtree[i] = Integer.MAX_VALUE;
		return;
	}
	
	public static void update(int i,int n,int x){
		i += n-1;
		segtree[i] = x;
		while(i>0){
			i = (i-1)/2;
			segtree[i] = Math.min(segtree[i*2+1], segtree[i*2+2]);
		}
		return;
	}

	public static int query(int a,int b,int k,int l,int r){ //a：左端、b：右端、k：l～rの区間に対応するノード番号
		if(r <= a || b <= l) return Integer.MAX_VALUE; //完全に外れている場合は候補から外す
		if(a <= l && r <= b) return segtree[k];   //完全に含まれている場合は候補とする(再帰的に呼び出されているのでここが最適解)
		else{
			int vl = query(a,b,k*2+1,l,(l+r)/2);
			int vr = query(a,b,k*2+2,(l+r)/2,r);
			return Math.min(vl, vr);
		}
	}
}


Measured memory_bytes: 104556
#include <iostream>
using namespace std;
int main(void){
    
    int D;
    
    cin >> D;
    
    if(D == 25) cout << "Christmas" << endl;
    else if(D == 24) cout << "Christmas Eve" << endl;
    else if(D == 23) cout << "Christmas Eve Eve" << endl;
    else if(D == 22) cout << "Christmas Eve Eve Eve" << endl;
    
    return 0;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()

int main(){
  int N;
  string s;
  cin >> N >> s;
  int x = 0;
  int ans = 0;
  for(char c : s){
    if(c == 'I') {
      x++;
    }
    else{
      x--;
    }
    ans = max(ans , x);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
/******************************************************************************

                            Online C Compiler.
                Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.

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

#include <stdio.h>

int bubbleSort(int A[], int N){
    int sw = 0;
    int tmp;
    int flag = 1;
    int j;
    
    while(flag){
        flag =0;
        for (j=N-1; j>0; --j){
            if(A[j] <A[j-1]){
            tmp = A[j]; A[j] = A[j-1]; A[j-1] = tmp;
            flag =1;  //交換が起きたらflagが1になるけど、交換が無かったら0のままなのでwhileループが止まる
            sw++;
        }
        }
    }
    return sw;
}

int main(){
    int A[100];
    int N;
    int i;
    int sw;
    
    scanf("%d",&N);
    for(i=0; i<N; i++){
        scanf("%d",&A[i]);
    }
    sw = bubbleSort(A,N);
    
    for (i = 0; i<N; i++){
        if(i > 0) printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
    printf("%d\n",sw);
}


Measured memory_bytes: 2068
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		boolean flag[]=new boolean[64];
		
		int n=in.nextInt();
		PrintWriter out=new PrintWriter(System.out);
		for(int i=0;i<n;i++) {
			int odr=Integer.parseInt(in.next());
			
			switch(odr){
				case 0:
					int index0=Integer.parseInt(in.next());
					out.println((flag[index0])? 1:0);
					break;
					
				case 1:
					int index1=Integer.parseInt(in.next());
					flag[index1]=true;
					break;
					
				case 2:
					int index2=Integer.parseInt(in.next());
					flag[index2]=false;
					break;
					
				case 3:
					int index3=Integer.parseInt(in.next());
					flag[index3]=(flag[index3])? false:true;
					break;
					
				case 4:
					int cnt1=0;
					for(int j=0;j<64;j++)if(flag[j])cnt1++;
					if(cnt1==64)out.println(1);
					else out.println(0);
					break;
					
				case 5:
					int cnt2=0;
					for(int j=0;j<64;j++)if(flag[j])cnt2++;
					if(cnt2>0)out.println(1);
					else out.println(0);
					break;
					
				case 6:
					int cnt3=0;
					for(int j=0;j<64;j++)if(flag[j])cnt3++;
					if(cnt3==0)out.println(1);
					else out.println(0);
					break;
					
				case 7:
					int cnt4=0;
					for(int j=0;j<64;j++)if(flag[j])cnt4++;
					out.println(cnt4);
					break;
					
				case 8:
					long dec=0;
					for(int j=0;j<64;j++) {
						if(flag[j]) {
							dec+=pow(j);
						}
					}
					out.println(Long.toUnsignedString(dec));
					out.flush();
					break;
			}
		}
		out.flush();
	}
	
	static long pow(int p) {
		long res=1;
		for(int i=0;i<p;i++)res*=2;
		return res;
	}

}



Measured memory_bytes: 80664
#include<iostream>

using namespace std;

bool checkOddOrEven(int num){
    int counter = 0;

    for(; num > 0; counter++){
        num /= 10;
    }
    if(counter % 2 == 1){ return true; } else { return false; }
}

int main(){
    int n;
    int count = 0;

    cin >> n;

    for(int i = 0; i <= n; i++){
        if(checkOddOrEven(i)){
            count++;
        }
    }

    cout << count;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

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

        System.out.println(row1.charAt(0) + "" + row2.charAt(1) + "" + row3.charAt(2));
    }
}


Measured memory_bytes: 21844
/***************************************************************
	File name: D.cpp
	Author: ljfcnyali
	Create time: 2019年09月01日 星期日 19时57分44秒
***************************************************************/
#include<bits/stdc++.h>

using namespace std;

#define REP(i, a, b) for ( int i = (a), _end_ = (b); i <= _end_; ++ i ) 
#define mem(a) memset ( (a), 0, sizeof ( a ) ) 
#define str(a) strlen ( a ) 
typedef long long LL;

int main()
{
    int n; scanf("%d", &n);
    LL ans = n; ans = ans * (n - 1) / 2;
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    string s;
    cin>>s;




    if(s[0]=='S' && s[1]=='A' && s[2]=='T')
    {
        cout<<1<<endl;
    }

    else if(s[0]=='S' && s[1]=='U' && s[2]=='N')
    {
        cout<<7<<endl;
    }

    else if(s[0]=='M' && s[1]=='O' && s[2]=='N')
    {
        cout<<6<<endl;
    }

    else if(s[0]=='T' && s[1]=='U' && s[2]=='E')
    {
        cout<<5<<endl;
    }


    else if(s[0]=='W' && s[1]=='E' && s[2]=='D')
    {
        cout<<4<<endl;
    }


    else if(s[0]=='T' && s[1]=='H' && s[2]=='U')
    {
        cout<<3<<endl;
    }

    else if(s[0]=='F' && s[1]=='R' && s[2]=='I')
    {
        cout<<2<<endl;
    }





    return 0;
}


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

int main () {
	int index, k, n, flag = 1, tmp, tmp2;

	scanf ("%d %d", &n ,&k);

	
	index = 1;
	for (int i=0; i<n; i++) {
		scanf ("%d", &tmp);
		if (flag) {
			if (tmp==1)
				flag = 0;
			else
				index ++;
		}
	}
	/*
	tmp = (int)(ceil ((index-1.0)/(k-1.0))) + (int)(ceil ((n-index)/(k-1.0)));
	tmp2 = (int)(ceil ((index-k/2

	if ((k%2==1) && (index%k==k/2+1))
		printf ("%d\n", tmp-1);
	else
		printf ("%d\n", tmp);
	*/

	printf ("%d\n", (int)(ceil ((n-1.0) / (k-1.0))));

	return 0;
}


Measured memory_bytes: 128
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {

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

		int n = sc.nextInt();
		Map<Integer, Integer> d = new HashMap<>();

		for (int i = 0; i < n; i++) {
			int temp = sc.nextInt();
			if (d.containsKey(temp)) {
				int cnt = d.get(temp);
				d.remove(temp);
				d.put(temp, cnt + 1);
			} else {
				d.put(temp, 1);
			}
		}

		int m = sc.nextInt();
		Map<Integer, Integer> t = new HashMap<>();
		for (int i = 0; i < m; i++) {
			int temp = sc.nextInt();
			if (t.containsKey(temp)) {
				int cnt = t.get(temp);
				t.remove(temp);
				t.put(temp, cnt + 1);
			} else {
				t.put(temp, 1);
			}
		}

		boolean ans = true;
		for (int key : t.keySet()) {
			if (d.containsKey(key)) {
				if (d.get(key) >= t.get(key)) {
				} else {
					ans = false;
				}
			} else {
				ans = false;
			}
		}

		if	(ans) {
			System.out.print("YES");
		} else {
			System.out.print("NO");
		}

	}

}



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

using i64 = int64_t;

constexpr i64 MOD = 1e9 + 7;

i64 extgcd(i64 a, i64 b, i64 &x, i64 &y) {
    i64 d = a;
    if (b != 0) {
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    } else {
        x = 1;
        y = 0;
    }
    return d;
}

i64 multi_inv(i64 a, i64 md) {
    i64 x, y;
    extgcd(md, a, x, y);
    return (y > 0 ? y : md + y);
}

map<i64, i64> prime_factor(i64 n) {
    map<i64, i64> res;
    for (i64 i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            res[i]++;
            n /= i;
        }
    }
    if (n != 1)
        res[n] = 1;
    return res;
}


int main(){
    i64 n, m;
    cin >> n >> m;
    map<i64, i64> factors = prime_factor(m);

    i64 comb = n, c = 1, ans = 1;
    for(auto e: factors){
        i64 factor = e.first, num = e.second;
        while(num > c){
            comb *= multi_inv(c+1, MOD);
            comb %= MOD;
            comb *= n + c;
            comb %= MOD;
            c++;
        }
        while(num < c){
            comb *= c;
            comb %= MOD;
            comb *= multi_inv(n-1+c, MOD);
            comb %= MOD;
            c--;
        }
        ans *= comb;
        ans %= MOD;
    }

    cout << ans << endl;

    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 repf(i, f, l) for(int i = f; i < (int)l; ++i)
#define repit(it, t) for(__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++)
#define endl "\n"
#define pb emplace_back
#define lb lower_bound
#define int long long
#define ul unsigned long
#define ull unsigned long long
#define ll long long
#define INF 1000000007
#define MOD 1000000007
#define fs first
#define sd second
#define DBG0(x) { cout << #x << ": " << x << "\t"; }
#define DBG(x) {DBG0(x); cout << endl;}
#define DBG2(x, y) {DBG0(x); DBG(y);}
#define DBG3(x, y, z) {DBG0(x); DBG2(y, z);}
#define DBG4(w, x, y, z) {DBG0(w); DBG3(x, y, z);}

typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef vector<bool> vbl;
typedef pair<int, int> pii;

signed main(void){
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vint ts = vint(n);
    vint ds = vint(n);
    rep(i, n) {
        cin >> ts[i] >> ds[i];
    }
    int kds;
    {
        set<int> s;
        rep(i, n) s.insert(ts[i]);
        kds = s.size() > k ? k : s.size();
    }

    vector<pii> dss;
    rep(i, n) dss.push_back(pii(ds[i], ts[i]));
    sort(dss.begin(), dss.end());
    reverse(dss.begin(), dss.end());

    vint ans = vint(n + 1, -1);

    map<int, int> mp = map<int, int>();
    set<int> types;
    priority_queue<pii, vector<pii>, std::greater<pii>> que;
    priority_queue<pii, vector<pii>> get_que;

    int t_ans = 0;
    rep(i, n) {
        if (i < k) {
            que.push(dss[i]);
            t_ans += dss[i].fs;
            int ttt = dss[i].sd;
            if (mp.find(ttt) == mp.end()) {
                mp.insert(pii(ttt, 1));
            } else {
                mp[ttt]++;
            }
        } else {
            get_que.push(dss[i]);
        }
    }

    int init_k = mp.size();
    ans[init_k] = t_ans + init_k * init_k;
    repf(i, init_k + 1, kds + 1) {
        while (true) {
            pii dt = que.top();
            que.pop();
            int d = dt.fs;
            int t = dt.sd;
            if (mp[t] == 1) continue;
            t_ans -= d;
            mp[t]--;

            while (true) {
                pii newdt = get_que.top();
                get_que.pop();
                int dd = newdt.fs;
                int tt = newdt.sd;
                if (mp.find(tt) != mp.end()) {
                    continue;
                }
                t_ans += dd;
                mp.insert(pii(tt, 1));
                break;
            }

            break;
        }
        ans[i] = t_ans + i*i;
    }

    int fans = -1;
    rep(i, n + 1) {
        fans = fans > ans[i] ? fans : ans[i];
    }
    cout << fans << endl;
    return 0;
}


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

#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using ll = long long;

int main() {
    FAST;

    int x, y, i, j;
    cin >> x >> y;

    bool f = 0;

    for (i = 0; i <= x; ++i) {
        for (j = 0; j <= x; ++j) {
            if ((i+j == x) && (i*4+j*2 == y)) {
                f = 1;
                break;
            }
        }
    }

    cout << (f ? "Yes" : "No");

    return 0;
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
    int a[3][3];

int main(){
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++)
        {
            cin>>a[i][j];
        }
    }
    int n,b;
    cin>>n;
    while(n--){
        cin>>b;
        for(int i=0;i<3;i++)
        for(int j=0;j<3;j++)
            if(a[i][j]==b)
                a[i][j]=0;
    }
    for(int i=0;i<3;i++){
        int p=0,q=0;
        for(int j=0;j<3;j++){
            p+=a[i][j];
            q+=a[j][i];
        }
        if(p==0 || q==0)
        {
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    if(a[0][0]+a[1][1]+a[2][2]==0 || a[0][2] + a[1][1] + a[2][0] == 0)
    {
        cout<<"Yes"<<endl;
        return 0;
    }

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


Measured memory_bytes: 256
#include<iostream>
using namespace std; 
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(a<b){
        if(b<c){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }else{
        cout<<"No"<<endl;
    }
    return 0;    
}


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

namespace ITP1_7
{
    class Program
    {
        static string Join(List<int> l)
        {
            string s = "";
            for(int i = 0; i < l.Count; i++)
            {
                s += l[i].ToString();
                if(i != l.Count - 1) s += " ";
            }
            return s;
        }

        static void Main(string[] args)
        {
            int l = int.Parse(Console.ReadLine().Split(' ')[0]);

            List<List<int>> rc = new List<List<int>>();

            for(int i = 0; i < l; i++)
            {
                List<int> _t = Console.ReadLine()
                                      .Split(' ')
                                      .Select(e => int.Parse(e))
                                      .ToList();
                _t.Add(_t.Sum());
                rc.Add(_t);
            }

            List<int> sum = new List<int>();

            for(int j = 0; j < rc[0].Count; j++)
            {
                int _sum = 0;
                for(int k = 0; k < rc.Count; k++)
                    _sum += rc[k][j];
                sum.Add(_sum);
            }

            rc.Add(sum);

            foreach(List<int> c in rc)
               Console.WriteLine(Join(c));
        }
    }
}

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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 2111;

int n, m;
string g[maxn];
int l[maxn][maxn],r[maxn][maxn],u[maxn][maxn],d[maxn][maxn];

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

  cin>>n>>m;
  for (int i=0; i<n; i++) {
    cin>>g[i];
  }
  for (int i=0; i<n; i++) {
    for (int j=0; j<m; j++) {
      if (g[i][j]=='#') continue;
      l[i][j]=g[i][j]=='.';
      if (j) l[i][j]+=l[i][j-1];
      u[i][j]=g[i][j]=='.';
      if(i) u[i][j]+=u[i-1][j];
    }
    
  }

  for (int i=n-1; i>=0; i--) {
    for (int j=m-1; j>=0; j--) {
      if (g[i][j]=='#') continue;
      r[i][j]=g[i][j]=='.';
      r[i][j]+=r[i][j+1];
      d[i][j]=g[i][j]=='.';
      d[i][j]+=d[i+1][j];
    }
    
  }

  int best = 0;
  for (int i=0; i<n; i++) {
    for (int j=0; j<m; j++) {
      if (g[i][j]=='#') continue;
      int cur = l[i][j]+r[i][j]+d[i][j]+u[i][j]-3;
      best = max(cur, best);
    }
  }

  // for (int i=0; i<n; i++) {
  //   for (int j=0; j<m; j++) {
  //     cout<<l[i][j]<<" ";
  //   }
  //   cout<<endl;
  // }

  cout<<best<<endl;

  return 0;
}


Measured memory_bytes: 74112
#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define rep(i,a,b) for(uint32 i = (a); i < (b); ++i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define ALL(x) (x).begin(),(x).end()
#define C(x) std::cout << #x << " : " << x << std::endl
#define scanf scanf_s

using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;

template<typename T>
class hashmap64 {
	std::vector<std::pair<uint64, T>> map;
	uint64 mask, count, temp;
	uint64 hash64(uint64 key) {
		key ^= key << 13;
		key ^= key >> 19;
		return key ^ (key << 17);
	}
public:
	hashmap64() :map(1024, std::make_pair(~static_cast<std::uint_fast64_t>(0), T())) {
		mask = 1023; count = 0;
	}
	hashmap64(size_t s) :map(1<<s, std::make_pair(~static_cast<std::uint_fast64_t>(0), T())) {
		mask = (1 << s) - 1; count = 0;
	}
	T &operator[](uint64 suf) {
		temp = mask&hash64(suf);
		while (~map[temp].first) {
			if (map[temp].first == suf) {
				return map[temp].second;
			}
			temp = mask&(temp + 1);
		}
		std::cerr << "?????¨????????????????????§????????????\n";
		std::abort();
	}
	void insert(uint64 key, const T &value) {
		temp = mask&hash64(key);
		while (~map[temp].first) {
			if (map[temp].first == key) {
				map[temp].second = value;
				return;
			}
			temp = mask&(temp + 1);
		}
		map[temp] = std::make_pair(key, value);
		++count;
		if ((count << 1) > mask) {
			std::pair<uint64, T> mkey;
			mask = mask << 1 | 1;
			map.resize(mask + 1, std::make_pair(~static_cast<std::uint_fast64_t>(0), T()));
			for (uint64 t = 0;t <= mask >> 1;++t) {
				if (!~map[t].first) {
					mkey = map[t];
					map[t].first = ~0;
					temp = mask&hash64(mkey.first);
					while (~map[temp].first) {
						temp = mask&(temp + 1);
					}
					map[temp] = mkey;
				}
			}
		}
		return;
	}
	bool find(uint64 key) {
		temp = mask&hash64(key);
		while (~map[temp].first) {
			if (map[temp].first == key) {
				return true;
			}
			temp = mask&(temp + 1);
		}
		return false;
	}
	bool empty(void) {
		return !count;
	}
	size_t size(void) {
		return count;
	}
};
int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	std::unordered_map<uint64,uint32> map;
	uint32 n;
	std::cin >> n;
	int64 a,sum = 1e15;
	uint32 ans = 0;
	map.reserve(200001);
	map[sum] = 0;
	rep(i, 0, n) {
		std::cin >> a;
		sum += a;
		if (map.find(sum)!=map.end()) {
			ans = std::max(ans,i+1-map[sum]);
		}
		else {
			map[sum] = i + 1;
		}
	}
	std::cout << ans << "\n";
	return 0;
}

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

int main(int argc, char *argv[])
{
  string s;
  getline(cin, s);
  for(int i = 0; i < (int)s.length(); i++) {
    if(isalpha(s[i])) {
      if(islower(s[i])) {
        s[i] = toupper(s[i]);
      }
      else if(isupper(s[i])) {
        s[i] = tolower(s[i]);
      }
    }
  }

  cout << s << endl;
  return 0;
}



Measured memory_bytes: 3168
H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

dx = [1, 0, -1, 0, 1, -1, -1, 1]
dy = [0, 1, 0, -1, 1, 1, -1, -1]

for h in range(H):
    for w in range(W):
        if S[h][w] == "#": 
            continue
        num = 0
        for d in range(8):
            hd, wd = h + dy[d], w + dx[d]

            if hd < 0 or H <= hd: continue
            if wd < 0 or W <= wd: continue
            if S[hd][wd] == "#": num += 1
        S[h][w] = str(num)

for h in range(H):
    print("".join(S[h]))


Measured memory_bytes: 3188