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



int main() {
    #ifdef DEBUG
        freopen("in.txt", "r", stdin);
    #endif
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);

    int n10_mn = 101;
    int sum = 0;
    int n; cin >> n;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        sum += x;
        if (x % 10 != 0) {
            n10_mn = min(n10_mn, x);
        }
    }

    if (sum % 10 == 0) {
        if (n10_mn == 101) {
            cout << "0\n";
        } else {
            cout << sum - n10_mn << '\n';
        }
    } else {
        cout << sum << '\n';
    }


    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <complex>
#include <cstdio>

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

typedef complex<double> P;

// ??????
double dot(const P& a, const P& b) {
    return real(conj(a)*b);
}

// ???p2?????????p0, p1???????????´???????°???±?????????
P projection(const P& p0, const P& p1, const P& p2) {
    // ???????????????????????´???
    P vec1 = p1 - p0;
    P vec2 = p2 - p0;
    return p0 + vec1 * dot(vec1, vec2) / dot(vec1, vec1);
}

// ???p0, p1???????????´??????????§°?????¨????????????p2??¨????§°??????
P reflection(const P& p0, const P& p1, const P& p2) {
    P proj = projection(p0, p1, p2);
    return proj - (p2 - proj);
}

// // ????????¨???P??¨??????????????????????????¢
// double norm(const P& a, const P& b) {
//     return dot(
//     return real(conj(a)*b);
// }

int main(){
    double x0, y0, x1, y1;
    int Q;

    cin >> x0 >> y0 >> x1 >> y1;
    
    P p0(x0, y0);
    P p1(x1, y1);

    cin >> Q;
    REP(q, Q) {
        double x2, y2;
        cin >> x2 >> y2;
        P p2(x2, y2);
        auto ret = reflection(p0, p1, p2);
        printf("%.10lf %.10lf\n", ret.real(), ret.imag());
    }
}

Measured memory_bytes: 1240
#include<iostream>
using namespace std;
#define rep(i, n) for ( int i = 0; i < n; i++ )
#define N 12

void dfs(int i, int j, char G[N][N] ){
  G[i][j] = '0';
  static const int di[4] = {0, -1, 0, 1};
  static const int dj[4] = {1, 0, -1, 0};
  int ni, nj;
  rep(r, 4){
    ni = i + di[r];
    nj = j + dj[r];
    if ( ni < 0 || nj < 0 || ni >= N || nj >= N ) continue;
    if ( G[ni][nj] == '0' ) continue;
    dfs(ni, nj, G);
  }
}

int compute(char G[N][N] ){
  int cnt = 0;
  rep(i, N) rep(j, N){
    if ( G[i][j] == '1' ) {
      cnt++;
      dfs(i, j, G);
    }
  }
  return cnt;
}

main(){
  char G[N][N];
  while( cin >> G[0][0] ){
    for ( int j = 1; j < N; j++ ) cin >> G[0][j];
    for ( int i = 1; i < N; i++ ) rep(j, N) cin >> G[i][j];
    cout << compute(G) << endl;
  }
}

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

#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
 
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
 
#if 1
//-------------
// DUMPマクロ
// https://www.creativ.xyz/dump-cpp-652/
 
// vector
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    for (T& x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&& ... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef DEBUG
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif
#endif



signed main(){
    int H, W, N;
    cin >> H >> W >> N;
    
    if(H<W) swap(H,W);
    
    cout << (N+H-1)/H << endl;
}


Measured memory_bytes: 256
from collections import deque
k=int(input())

lis = deque([i for i in range(1,10)])
for _ in range(k-1):
    x=lis.popleft()
    if x%10!=0:
        lis.append(10*x+(x%10)-1)
    lis.append(10*x+(x%10))
    if x%10!=9:
        lis.append(10*x+(x%10)+1)
print(lis.popleft())

Measured memory_bytes: 11908
import sys
from collections import deque
import copy

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    N = int(input_raw[0])
    Q = [0 for i in range(N + 1)]
    count = 0
    for i in range(N):
        input_raw = read_func().strip().split()
        Q[int(input_raw[0])] = i

    count = 1
    max_count = 0
    for i in range(1, N):
        if Q[i] < Q[i + 1]:
            count += 1
        else:
            max_count = max(max_count, count)
            count = 1
    if max_count == 0:
        max_count = N

    print N - max_count


if __name__ == '__main__':
    main()


Measured memory_bytes: 15676
"use strict";
function main(input) {
  let n = parseInt(input[0]);
  let x = input[1].trim().split(" ");
  
  for(let i=0;i<x.length;i++){
    x[i] = parseInt(x[i]);
  }
  
  x.sort(function(a, b) {
    return b - a;
  });

  let sum = [];

  for(let i=0;i<x[0]+1;i++){
    sum[i] = 0;
    for(let j=0;j<x.length;j++){
      sum[i] += Math.pow((i - x[j]),2);
    } 
  }

  console.log(Math.min(...sum));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));

Measured memory_bytes: 9420
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>
#include <cstring>

using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define FIND(x, target) find(x.begin(),x.end(),target)
#define pb(x) push_back(x)
#define output(x) cout<<x<<endl
#define ERASE(x, n) x.erase(x.begin(), x.begin()+n)
// #define int long long
#define P pair<int, int>
typedef long long ll;

const long long int MOD = 1e9+7;
const int INF = -1;

// i: layer
// j: the number haven't been decided
// k: k at that time (if not connected, k is increased with the number)
ll dp[51][51][2501];
vector<int> A;
vector<int> ans;

signed main(void) {
  	int n, K;
  	cin >> n >> K;
  	dp[0][0][0] = 1;

  	for (int i=0; i<n; i++) {
  		for (int j=0; j<=i; j++) {
  			for (int k=0; k<=K; k++) {
  				{
  					int nj = j;
  					dp[i+1][nj][k+nj*2] += dp[i][j][k];
  					dp[i+1][nj][k+nj*2] %= MOD;
  				}
  				{
  					int nj = j+1;
  					dp[i+1][nj][k+nj*2] += dp[i][j][k];
  					dp[i+1][nj][k+nj*2] %= MOD;
  				}
  				{
  					int nj = j;
  					dp[i+1][nj][k+nj*2] += 2 * j * dp[i][j][k];
  					dp[i+1][nj][k+nj*2] %= MOD;
  				}
  				{
  					int nj = j-1;
  					dp[i+1][nj][k+nj*2] += j * j * dp[i][j][k];
  					dp[i+1][nj][k+nj*2] %= MOD;
  				}
   			}
  		}
  	}
 	cout << dp[n][0][K]%MOD << endl;
	return 0;
}


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

    for(int i = 1; i <= 9; i++){
        for(int j = 1; j <= 9; j++){
            int muliple = i * j;
            if(muliple == N){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
                cout << "No" << endl;
                return 0;
 

    return 0;
}

Measured memory_bytes: 3592
a,n=map(int,input().split())
d=[0]*n
b=[int(ss) for ss in input().split()]
#print(b)
for ii in range(n-1):
  d[ii+1]=b[ii+1]-b[ii]
#  b[ii]=(2*b[ii]+a)%(2*a)
#  print(b[ii])
d[0]=a-b[n-1]+b[0]
d=sorted(d)
#print(d)
print(a-max(d))

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

using namespace std;

const int N = 200200;

char Buffer[N];

string Read()
{
    scanf("%s", Buffer);
    return Buffer;
}

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

    map <string, int> Cnt;

    for(int i = 0; i < n; i++)  Cnt[Read()]++;

    int Max = 0;

    for(auto it : Cnt)  Max = max(Max, it.second);

    for(auto it : Cnt)
        if(it.second == Max)
            puts(it.first.c_str());
}


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

class Person {
	int m_Var;
	int m_EatCount;

public:

	Person(int var);
	bool IsEatDay(int day);
};

Person::Person(int var) {
	this->m_EatCount = 0;
	this->m_Var = var;
}

bool Person::IsEatDay(int day){
	if (day == m_Var * m_EatCount + 1) {
		m_EatCount++;
		return true;
	}else {
		return false;
	}
}

int main() {

	int personCount;
	int maxDay;
	int chocoCount;
	vector<Person> persons;

	cin >> personCount;
	cin >> maxDay >> chocoCount;

	for (int i = 0; i < personCount; i++) {
		int aa;
		cin >> aa;
		persons.emplace_back(aa);
	}

	int eatCount = 0;
	for (int day = 1; day <= maxDay; day++) {
		for (auto &per : persons) {
			if (per.IsEatDay(day)) {
				eatCount++;
			}
		}
	}

	cout << chocoCount + eatCount << endl;

}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
typedef long long ll;
using namespace std;


typedef struct Node {
	int key;
	Node *parent, *lchild, *rchild;
	Node(int k, Node *p = NULL, Node *l = NULL, Node *r = NULL) : key(k), parent(p), lchild(l), rchild(r) {}
} *Tree;

void insert(Tree& T,  int k)
{
	Tree p = NULL;
	Tree x = T;
	Tree z;
	while (x != NULL)
	{
		p = x;
		if (x->key > k)
			x = x->lchild;
		else
			x = x->rchild;
	}
	z = new Node(k, p);
	if (p == NULL)
	{
		T = z;
	}
	else if (z->key > p->key)
		p->rchild = z;
	else
		p->lchild = z;
}

void preorder(Tree T)
{
	if (T == NULL)
		return;
	cout << ' ' << T->key;
	preorder(T->lchild);
	preorder(T->rchild);
}

void inorder(Tree T)
{
	if (T == NULL)
		return;
	inorder(T->lchild);
	cout << ' ' << T->key;
	inorder(T->rchild);
}

void Print(Tree T)
{
	inorder(T);
	cout << endl;
	preorder(T);
	cout << endl;
}

int main()
{
	int n, key;
	char op[10];
	Tree T = NULL;
	Tree *temp;

	cin >> n;
	while (n--)
	{
		cin >> op;
		if (op[0] == 'i')
		{
			cin >> key;			
			insert(T, key);
		}
		else
			Print(T);
	}

	return 0;
}

Measured memory_bytes: 26508
#include <stdio.h>

typedef struct List {
	struct List *next;
	int v;
} list;

int main()
{
	int i, N, M, u, w;
	list *adj[200001] = {}, e[400001];
	scanf("%d %d", &N, &M);
	for (i = 0; i < M; i++) {
		scanf("%d %d", &u, &w);
		e[i*2].v = w;
		e[i*2+1].v = u;
		e[i*2].next = adj[u];
		e[i*2+1].next = adj[w];
		adj[u] = &(e[i*2]);
		adj[w] = &(e[i*2+1]);
	}
	
	int flag[200001] = {}, q[200001], head, tail, max = 0;
	list *p;
	for (i = 1; i <= N; i++) {
		if (flag[i] != 0) continue;
		flag[i] = 1;
		q[0] = i;
		for (head = 0, tail = 1; head < tail; head++) {
			u = q[head];
			for (p = adj[u]; p != NULL; p = p->next) {
				w = p->v;
				if (flag[w] == 0) {
					flag[w] = 1;
					q[tail++] = w;
				}
			}
		}
		if (tail > max) max = tail;
	}
	printf("%d\n", max);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 11024
// finish date: 2018/02/24

#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvvi vector<vector<vector<int>>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vvd vector<vector<double>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define bigmod 1000000007
#define INF 1050000000
#define pii pair<int,int>


int main() {
    int a, b;
    cin >> a >> b;
    if ((ll) a * b <= 0) cout << "Zero" << endl;
    else if (a > 0) cout << "Positive" << endl;
    else if (min(0 - a, b - a + 1) % 2 == 0) cout << "Positive" << endl;
    else cout << "Negative" << endl;

    return 0;
}





Measured memory_bytes: 256
s = input()
n = len(s)
t = input()
m = len(t)
c_max = 0
for i in range(n - m + 1):
    c = 0
    for j in range(m):
        if s[i + j] == t[j]:
            c += 1
    if c > c_max:
        c_max = c
print(m - c_max)

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

int func(int n){
  if(n%2==0) return n/2;
  else return 3*n+1;
}

int main() {
  int x1,y1,x2,y2; 
  cin>>x1>>y1>>x2>>y2;
  int dx = x2-x1;
  int dy = y2-y1;
  int x = x2;
  int y = y2;
  rep(i,2){
    swap(dx,dy);
    dx = -dx;
    x += dx;
    y += dy;
    cout<<x<<' '<<y<<endl;
  }
}

Measured memory_bytes: 256
'''冷めたコーヒー
入力文字列として、S = 31415926535を考えます。
このとき、例えば4番目から8番目までの部分文字列15926が
2019の倍数であるか判定したいというのが本問の主題です。
特定の部分文字列が2019の倍数であるかどうかは、
int(s[[i:j+1]) % 2019 == 0とすればよいのですが、
これを逐一やっていてはO(N^2)の計算量がかかってしまいます。
そこで、この部分文字列を次のようにとらえてみます。
15926=(15926535−535)/10^3
このように考えることの利点は、10^3 が 2019 と
互いに素（最大公約数が 1）であるため、
15926 が 2019 の倍数であるかどうかは、
上式右辺の分子に着目すればよいということです。
したがって、アルゴリズムを設計する際は、
与えられた文字列の右からk番目（0～n)から最右端までの
部分文字列を保持しておけばよいことになります。
分子が 2019 の倍数かどうかは、分子を A−B としたときに、
A mod2019 と B mod2019 の値がそれぞれ等しければ、
元の整数（上式左辺）は 2019 の倍数であると言えます。
'''
s = input()[::-1] # 入力文字列を逆順でsに格納

counts = [0] * 2019#2019で割った余りの個数をカウント
counts[0] = 1#その数が、ちょうど2019で割れた時のために必要

num, d = 0, 1

for char in s:
    num += int(char) * d#1桁目から数字を作る、整数型にする
    num %= 2019
    d *= 10
    d%= 2019
    counts[num] += 1#2019で割った余りの個数を足す1

ans = 0
for cnt in counts:
    ans += cnt * (cnt - 1) // 2
    #余りが同じものを2つ選ぶ組み合わせの数が答

print(ans) # 答えの出力

Measured memory_bytes: 9384
#include "bits/stdc++.h"
using namespace std;

#define int long long
#define PB push_back
#define PPB pop_back
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<string, int> psi;

static const int INF = 1LL << 60;
//static const int MOD = 1000000007;

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

    int n, k, d[15];
    cin >> n >> k;
    for (int i = 0; i < k; ++i) cin >> d[i];

    for (int i = n; ; ++i) {
        bool ok = true;
        for (int j = 10; j <= i * 10; j *= 10) {
            int tmp = (i % j) / (j / 10);
            for (int l = 0; l < k; ++l) {
                if (tmp != d[l]) continue;
                ok = false;
                break;
            }
            if (!ok) break;
        }

        if (ok) {
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
ans=10**15
for i in [1,-1]:
    b=0
    c=0
    for j in a:
        b+=j
        if b*i<=0:
            c+=abs(b-i)
            b=i
        i*=-1
    ans=min(ans,c)
print(ans)

Measured memory_bytes: 14332
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
template <class T>
using ordered_set = __gnu_pbds::tree<T, __gnu_pbds::null_type, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
template <class T>
using ordered_multiset = __gnu_pbds::tree<T, __gnu_pbds::null_type, less_equal<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;

#define PI atan2(0, -1)
#define EPS 1e-9
#define INF 5e18
#define MOD 1000000007

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

int N;
long long arr [200010];

int main(){
    //freopen("sort.in", "r", stdin); freopen("sort.out", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(10);
    cin >> N;
    for(int i = 0; i < N; i++) cin >> arr[i];
    sort(arr, arr+N);
    long long ret = 0;
    if(N == 2) ret = arr[N-1];
    else if(N == 3) ret = arr[N-1]+arr[N-2];
    else if(N == 4) ret = arr[N-1]+2*arr[N-2];
    else{
        ret = arr[N-1]+2*arr[N-2];
        for(int i = N-3, cnt = 3; cnt < N-1; i--){
            if(cnt+1 < N-1) ret += 2*arr[i], cnt += 2;
            else ret += arr[i], cnt++;
        }
    }
    cout << ret << '\n';
    return 0;
}

/******************************
Kateba ii dake no hanashi darou
Success is only a victory away
- No Game No Life Opening
******************************/

Measured memory_bytes: 5212
//
// Created by Ильдар Ялалов on 14.01.2020.
//
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int inf_int = 1e9 + 100;
const ll inf_ll = 1e18;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double dbl;
typedef unsigned int uint;
#define pb push_back
#define eb emplace_back
const double pi = 3.1415926535898;
#define dout if(debug) cout
#define fi first
#define se second
#define sp setprecision
#define sz(a) (int(a.size()))
#define mp make_pair
#define all(a) a.begin(),a.end()

#ifdef zxc

#include "debug.h"

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

bool debug = 0;
const int MAXN = 2e5 + 100;
const int LOG = 21;
const int mod = 1e9 + 7;
const int MX = (1e7 + 100);

ll pref[MAXN];
int a[MAXN];

void solve() {
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
    }

    int pos = -1;
    for (int i = 2; i <= n; ++i) {
        if (a[i] + a[i - 1] >= m) {
            pos = i;
            break;
        }
    }
    if (pos == -1) {
        cout << "Impossible\n";
        return;
    }

    vector<int> ans;
    for (int i = n; i > pos; --i) {
        ans.pb(i - 1);
    }

    for (int i = 1; i < pos - 1; ++i) {
        ans.pb(i);
    }

    ans.pb(pos - 1);

    cout << "Possible\n";

    for(auto x : ans){
        cout << x <<"\n";
    }


}


// CHECK LIMITS (n <= 10^5)
// CHECK CORNER CASES ( n==1)
signed main() {
#ifdef zxc
    freopen("../input.txt", "r", stdin);
//    freopen("../output.txt", "w", stdout);
#else
#endif //zxc
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout.setf(ios::fixed);
    cout.precision(2);

    int t = 1;
    while (t--) {
        solve();
    }
    debug(1.0 * clock() / CLOCKS_PER_SEC);
}

Measured memory_bytes: 1784
#include<cstdio>
#include<cctype>
#include<iostream>
using namespace std;
int main()
{
	char ch;
	while(1)
	{
		scanf("%c",&ch);
		if(isalpha(ch)!=0){
			if(islower(ch)!=0) {printf("%c",toupper(ch));}
			else printf("%c",tolower(ch));
		}
		else printf("%c",ch);
        if(ch=='\n') break;
		
	}
	return 0;
}

Measured memory_bytes: 1108
N = int(input())
p_list = list(map(int, input().split()))

ap_list = sorted(p_list, reverse = False)

counter = 0

for i in range(N):
    if p_list[i] != ap_list[i]:
        counter += 1

if counter <= 2:
    print("YES")

else:
    print("NO")


Measured memory_bytes: 2940
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);++i)
int score[100];
int A[100];
int main() {
  ios::sync_with_stdio(false);
  int N, M; cin >> N >> M;
  REP(i,M) cin >> A[i];
  memset(score, 0, sizeof(score));
  REP(m,M) {
    REP(i,N) {
      int b; cin >> b;
      if(A[m] == b) {
        score[i]++;
      }
      else {
        score[A[m]-1]++;
      }
    }
  }
  REP(i,N) cout << score[i] << endl;
}

Measured memory_bytes: 1196
#include<bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define fi first
#define se second
#define sz(a) int(a.size())
#define clr(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int inf=1e9;
const ll Inf=1e18;
const int mod=1;
template<typename T=int>
T gi() {
    T x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
template<typename T> bool chkmax(T &a,T b) { return a<b?a=b,1:0; };
template<typename T> bool chkmin(T &a,T b) { return a>b?a=b,1:0; };
int add(int a,int b) { return a+b>=mod?a+b-mod:a+b; }
int sub(int a,int b) { return a-b<0?a-b+mod:a-b; }
void inc(int &a,int b) { a=(a+b>=mod?a+b-mod:a+b); }
void dec(int &a,int b) { a=(a-b<0?a-b+mod:a-b); }
string to_string(string s) { return '"'+s+'"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b?"true":"false"); }
template<typename A,typename B> string to_string(pair<A,B> p) {
    return "("+to_string(p.fi)+","+to_string(p.se)+")";
}
template<typename T> string to_string(T v) {
    int fst=1;string ret="{";
    for(auto x:v) {
        if(!fst) ret+=",";
        fst=0,ret+=to_string(x);
    }
    ret+="}";return ret;
}
void dbg_out() { cerr<<endl; }
template<typename Head,typename... Tail> void dbg_out(Head H,Tail... T) {
    cerr<<" "<<to_string(H);
    dbg_out(T...);
}
#define dbg(...) cerr<<"{"<<#__VA_ARGS__<<"}:",dbg_out(__VA_ARGS__)

template<typename T>
int qpow(int a,T b) {
    int ret=1;
    while(b) {
        if(b&1) ret=1ll*ret*a%mod;
        a=1ll*a*a%mod,b>>=1;
    }
    return ret;
}

const int N=2e5+10;

int n,Q,f[N];
vector<tuple<int,int,int>> e;

namespace dsu {

    int fa[N];

    void init() {
        for(int i=1;i<=n;i++) fa[i]=i;
    }

    int getf(int x) {
        return x==fa[x]?x:fa[x]=getf(fa[x]);
    }

    bool merge(int x,int y) {
        x=getf(x),y=getf(y);
        if(x==y) return 0;
        fa[y]=x;return 1;
    }
    
}

int main() {
    n=gi(),Q=gi();
    memset(f,0x3f,sizeof(f));
    while(Q--) {
        int a=gi()+1,b=gi()+1,c=gi();
        chkmin(f[a],c+1),chkmin(f[b],c+2);
        e.pb(mt(c,a,b));
    }
    for(int i=2;i<=n;i++) chkmin(f[i],f[i-1]+2);
    chkmin(f[1],f[n]+2);
    for(int i=2;i<=n;i++) chkmin(f[i],f[i-1]+2);
    for(int i=1;i<=n;i++) e.pb(mt(f[i],i,i%n+1));
    dsu::init();
    sort(all(e));
    ll ans=0;
    for(auto x:e) {
        int u=get<1>(x),v=get<2>(x),w=get<0>(x);
        if(dsu::merge(u,v)) ans+=w;
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 9200
#include<iostream>
#include<string>
using namespace std;
int main() {
	string s;
	cin >> s;
	int cnt = 0;
	for (int i = 0; i < s.length() - 1; i++) {
		if (s[i] == s[i + 1]) {
			cnt++;
		}
	}
	if (cnt == 0) {
		cout << "Good" << endl;
	}
	else {
		cout << "Bad" << endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
   int x, y,z;
   scanf("%d%d",&x,&y);
   
   if (x >= y)  z = gcd(x,y);
   else  z = gcd(y,x);
   
   printf("%d\n", z);
  
   return 0; 

}

int gcd(int x,int y){
   if (x % y == 0) return y;
   else   gcd(y, x%y);
}

Measured memory_bytes: 592
k, n = list(map(int, input().split(" ")))
a = list(map(int, input().split(" ")))
s = []
for i in range(len(a)-1):
    s.append(a[i+1] - a[i])
s.append(a[0] + k - a[-1])
print(sum(s) - max(s))

Measured memory_bytes: 26444
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  string s;
  cin >> s;
  for(int i=0; i<3; i++) {
    if(s[i]=='1') {
      cout << 9;
    }
    else {
      cout << 1;
    }
  }
  cout << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
    int a, b;

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

    if( a > 0 ) 
        puts( "Positive");
    else if( a < 0 && b > 0 )
        puts( "Zero" );
    else
    {
        if ((b - a + 1) % 2 == 0)
            printf("Positive\n");
        else
            printf("Negative\n");
    }
    return 0;

}


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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    long long ans = 0;
    for(int b = 1; b <= n; b++){
        ans += (n/b) * max(0, b-k);
        ans += max(0, n%b-k+1);
    }
    if(k == 0) ans -= n;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
using namespace std;
typedef long long ll;

const int maxN = 3e3 + 5;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;

ll gcd(ll a, ll b){return !b ? a : gcd(b, a % b);}
ll modP(ll a, ll b) {return (!b ? 1 : (modP(a, b / 2) * modP(a, b / 2) * (b % 2 ? a : 1)) % MOD);}

int n, m, i, j, l;
int LCS[maxN][maxN];
string s, t, r;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> s >> t;
	n = s.size();
	m = t.size();
	for (i = 1; i <= n; i++){
		for (j = 1; j <= m; j++){
			if (s[i - 1] == t[j - 1]){
				LCS[i][j] = LCS[i - 1][j - 1] + 1;
			}
			else{
				LCS[i][j] = max(LCS[i - 1][j], LCS[i][j - 1]);
			}
		}
	}
	for (i = 0; i < LCS[n][m]; i++){
		r += '0';
	}
	l = LCS[n][m];
	while (n > 0 && m > 0){
		if (s[n - 1] == t[m - 1]){
			r[l - 1] = s[n - 1];
			l -= 1;
			n -= 1;
			m -= 1;
		}
		else{
			if (LCS[n - 1][m] > LCS[n][m - 1]){
				n -= 1;
			}
			else{
				m -= 1;
			}
		}
	}
	cout << r << endl;
	return 0;
}



Measured memory_bytes: 35456
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#define FOR(i,a,b) for (int i=a;i<=b;++i)
#define FORD(i,a,b) for (int i=a;i>=b;--i)
using namespace std;
typedef long long LL;
typedef pair<int,int> pa;
typedef vector<int> vec;
void getint(int &v){
    char ch,fu=0;
    for(ch='*'; (ch<'0'||ch>'9')&&ch!='-'; ch=getchar());
    if(ch=='-') fu=1, ch=getchar();
    for(v=0; ch>='0'&&ch<='9'; ch=getchar()) v=v*10+ch-'0';
    if(fu) v=-v;
}
const int MO=1e9+7;
LL ans;
char s[500010];
int cnt[500010],n;
int main(){
	cin>>n;
	scanf("%s",s+1);
	FOR(i,1,n) ++cnt[s[i]];
	ans=1;
	FOR(i,'a','z') ans=ans*(cnt[i]+1)%MO;
	--ans;
	ans=(ans%MO+MO)%MO;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N, A, B;
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N>>A>>B;
  cout<<min(A,B)<<" " <<max(A+B-N,0)<< "\n";
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define inf 2e18
#define pi acos(-1)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
vector<int>v;
set<int>s;
int a[2*100005];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    string s,t;
    cin>>s>>t;
    cout<<t+s<<endl;
}



Measured memory_bytes: 256
import sys

DICT = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

d = set(DICT)
s = set(list(sys.stdin.readline().strip()))

z = sorted(list(d-s))

if len(z) >= 1:
    print(z[0])
else:
    print('None')

Measured memory_bytes: 3956
#include"bits/stdc++.h"

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

LL modinv(LL a) {
    LL b = MOD, u = 1, v = 0;
    while (b) {
        LL t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= MOD;
    if (u < 0) u += MOD;
    return u;
}

LL moddev(LL a, LL b){
	return a * modinv(b) % MOD;
}

void Main()
{
    int n;cin>>n;

    VPII w(n);
    REP(i,n){
        int a,b;
        cin>>a>>b;
        w[i] = MP(b,a);
    }

    SORT_ASC(w);

    int now=0;
    REP(i,n){
        now += w[i].second;
        if(now > w[i].first){
            cout<<"No"<<endl;
            return;
        }
    }
    cout<<"Yes"<<endl;

	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Measured memory_bytes: 1920
n = int(input())
dp = [[0 for _ in range(3)] for _ in range(n+1)]
ls  = [[1,2],[0,2],[0,1]]
for i in range(1,n+1):
    day = list(map(int,input().split()))
    dp[i][0] = day[0] + max(dp[i-1][1],dp[i-1][2])
    dp[i][1] = day[1] + max(dp[i-1][0],dp[i-1][2])
    dp[i][2] = day[2] + max(dp[i-1][0],dp[i-1][1])
print(max(dp[n]))


Measured memory_bytes: 62172
N=int(input())
E={"*":0}
for _ in range(N):
    S=input()
    if S in E:
        E[S]+=1
    else:
        E[S]=1

M=int(input())
for _ in range(M):
    S=input()
    if S in E:
        E[S]-=1
    else:
        E[S]=-1

print(max(E.values()))


Measured memory_bytes: 62592
#include <iomanip>
#include <iostream>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  string N;
  cin >> N;
  for (int i = 0; i < 3; ++i) {
    if (N[i] == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String[] s=new String[3];
		for(int i=0;i<3;i++)s[i]=sc.next();
		System.out.println("A"+s[1].charAt(0)+"C");
	}
}
	

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

#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;

struct mint {
  ll v;
  mint() : v(0) {}
  mint(ll v) : v((v % MOD + MOD) % MOD) {}
  operator ll() const { return v; }
  mint pow(ll t) const;
  mint inv() const;
};
mint& operator+=(mint& a, mint b) { return a = a.v + b.v; }
mint& operator-=(mint& a, mint b) { return a = a.v - b.v; }
mint& operator*=(mint& a, mint b) { return a = a.v * b.v; }
mint operator+(mint a, mint b) { return a += b; }
mint operator-(mint a, mint b) { return a -= b; }
mint operator*(mint a, mint b) { return a *= b; }
mint operator-(mint a) { return (mint)0 - a; }
mint& operator/=(mint& a, mint b) { return a *= b.inv(); }
mint operator/(mint a, mint b) { return a /= b; }
mint mint::pow(ll t) const {
  if (!t) return 1;
  mint a = pow(t >> 1);
  a *= a;
  if (t & 1) a *= *this;
  return a;
}
mint mint::inv() const { return pow(MOD - 2); }
bool operator==(mint a, mint b) { return a.v == b.v; }
bool operator!=(mint a, mint b) { return a.v != b.v; }
istream& operator>>(istream& os, mint& a) { return (os >> a.v); }
ostream& operator<<(ostream& os, const mint& a) { return (os << a.v); }

mint dp[100005][3];
int cnt[100005][3];

void solve() {
  int n;
  cin >> n;
  vi a(n);
  rep(i, n) cin >> a[i];
  dump(a);
  vi cnt(3);
  mint ans = 1;
  rep(i, n) {
    int x = count(cnt.begin(), cnt.end(), a[i]);
    ans = ans * (mint)x;
    if (cnt[0] == a[i]) {
      cnt[0]++;
    } else if (cnt[1] == a[i]) {
      cnt[1]++;
    } else {
      cnt[2]++;
    }
    dump(i, x, cnt);
  }
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  // freopen("temp.1", "r", stdin);
  solve();
  return 0;
}

Measured memory_bytes: 2944
# B
S = input()
compare = "keyence"
j = -1
for i in range(7):
    if S[i] != compare[i]:
        j = i
        break
if j >= 0:
    if S[-(7-j):] == compare[-(7-j):]:
        print("YES")
    else:
        print("NO")
else:
    print("YES")




Measured memory_bytes: 3060
def main():
    N = int(input())
    A = list(int(x) for x in input().split())
    ans = float('inf')


    for i in range(-100,100+1):
        ans_tmp = 0
        for a in A:
            ans_tmp += (a-i)**2

        if ans_tmp < ans:
            ans = ans_tmp

    print(int(ans))

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define maxn 3005
int dp[maxn][maxn][2];
#define p 1000000007
int n,m;
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=0;i<=n;i++) dp[0][i][0]=1;
	for (int i=0;i<m;i++)
	{
		for (int j=0;j<=n;j++)
			for (int k=0;k<=1;k++)
			{
				if (j==0)
				{
					dp[i+1][j+1][1]=(dp[i+1][j+1][1]+dp[i][j][k])%p;
					dp[i+1][j][1]=(dp[i+1][j][1]+dp[i][j][k])%p;		
				}
				else if (j==1)
				{
					dp[i+1][j][1]=(dp[i+1][j][1]+dp[i][j][k])%p;
					dp[i+1][j-1][1]=(dp[i+1][j-1][1]+dp[i][j][k])%p;
					if (j!=n)
					{dp[i+1][j][k]=(dp[i+1][j][k]+dp[i][j][k])%p;dp[i+1][j+1][k]=(dp[i+1][j+1][k]+dp[i][j][k])%p;}
				}
				else if (j==n)
				{
						dp[i+1][j][k]=(dp[i+1][j][k]+dp[i][j][k])%p;
						dp[i+1][j-1][k]=(dp[i+1][j-1][k]+dp[i][j][k])%p;

					}
				else {
					dp[i+1][j][k]=(dp[i+1][j][k]+dp[i][j][k])%p;
					dp[i+1][j-1][k]=(dp[i+1][j-1][k]+dp[i][j][k])%p;
					dp[i+1][j][k]=(dp[i+1][j][k]+dp[i][j][k])%p;
					dp[i+1][j+1][k]=(dp[i+1][j+1][k]+dp[i][j][k])%p;
				}
			}
	}
	long long ans=0;
	for (int i=0;i<=n;i++) ans=(ans+dp[m][i][1])%p;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 70656
# -*- coding:utf-8 -*-
h,w = map(int,input().split())
arr = []
for i in range(h):
    arr.append(input())


for i in range(w+2):
    print('#',sep = '',end = '')
print('')

for i in range(h):
    print('#',sep = '',end = '')
    print(arr[i],sep = '',end = '')
    print('#')

for i in range(w+2):
    print('#',sep = '',end = '')
print('')    


Measured memory_bytes: 3064
while True:

    table=input().split()
    a=int(table[0])
    op=table[1]
    b=int(table[2])
    if op=="?":
        break
    elif op== "+":
        print(a+b)
    elif op=="-":
        print(a-b)
    elif op== "*":
        print(a*b)
    elif op=="/":
        if a%b==0:
            print(round(a/b))
        else:
            print(round(a//b))



Measured memory_bytes: 5604
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }
typedef long long ll;
int main(int argc, char *argv[])
{
  int n,m;
  ll l;
  cin >> n >> m >> l;
  vector<int> a(m),b(m);
  vector<ll> c(m);
  rep(i,m) {
    cin >> a[i] >> b[i] >> c[i];
    a[i]--; b[i]--;
  }

  int q; cin >> q;
  vector<int> s(q),t(q);
  rep(i,q) {
    cin >> s[i] >> t[i];
    s[i]--; t[i]--;
  }

  const ll inf = (1LL << 60);
  vector<vector<ll>> edge(n, vector<ll>(n, inf));
  rep(i,m) {
    edge[a[i]][b[i]] = c[i];
    edge[b[i]][a[i]] = c[i];
  }
  rep(k,n) rep(i,n) rep(j,n) chmin(edge[i][j], edge[i][k] + edge[k][j]);

  vector<vector<ll>> edge2(n, vector<ll>(n));
  rep(i,n) {
    rep(j,n) {
      if(edge[i][j] <= l) edge2[i][j] = 1;
      else edge2[i][j] = inf;
    }
  }

  rep(k,n) rep(i,n) rep(j,n) chmin(edge2[i][j], edge2[i][k] + edge2[k][j]);  

  rep(i,q) {
    ll res = edge2[s[i]][t[i]];
    cout << (res == inf ? -1 : res-1) << "\n";
  }
  
  return 0;
}


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

class Program
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        var input = Console.ReadLine().Split();
        int count = 0;
        for(int i = 0; i < N; i++)
        {
            if (int.Parse(input[i]) != i + 1) { count++; }
        }
        if (count == 2||count==0) { Console.WriteLine("YES"); }
        else { Console.WriteLine("NO"); }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define FOR(idx, begin, end) for(int idx = (int)(begin); idx < (int)(end); ++idx)

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

using namespace std;
typedef long long lint;

const int MOD = 1000000007, INF = 1111111111;
const double EPS = 1e-9;


int main() {

	cin.tie(0);

	int A, B, C;
	cin >> A >> B >> C;

	cout << ((A <= C)&&(C <= B)? "Yes" : "No");

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main() {
    int N; cin >> N;
    vector<int> A(N);
    REP(i, 0, N) cin >> A[i];

    unordered_map<ll, ll> m;
    ll prev = 0;
    m[prev]++;
    REP(i, 0, N) {
        prev += A[i];
        m[prev]++;
    }

    ll ans = 0;
    for (auto elm : m) ans += elm.second * (elm.second - 1) / 2;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 12016
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1010;
int cnt[1010];
void factor(int n) {
    int tmp, i, now;
    tmp = sqrt(n + 0.5);
    now = n;
    for(i=2;i<=tmp;++i)
        if(now % i == 0) {
            while(now % i == 0) {
                cnt[i]++;
                now/=i;
            }
        }
    if(now != 1)
        cnt[now]++;
}

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        factor(i);
    long long ans = 1;
    for(int i=2;i<=n;i++)
        (ans *= (cnt[i]+1)) %= mod;
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define N
#define int long long
using namespace std;

#define v1 first
#define v2 second
#define pb push_back
#define mid ((l+r)>>1)
#define vec vector<int>
#define pr pair<int,int>
#define tp tuple<int,int,int>
#define sz(x) ((int) x.size())
#define all(x) x.begin(),x.end()
#define mem(a,x) memset(a,x,sizeof a)
#define For(x) for(int y,i=head[x];(y=e[i].to);i=e[i].nxt)

inline bool rd(int &X)
{
    X=0;int w=0;char ch=0;
    while(!isdigit(ch))w|=ch=='-',ch=getchar();
    while( isdigit(ch))X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
    X=w?-X:X; return 1;
}
int l,r,x;
signed main()
{
    cin>>l>>r>>x;
    if(!l) cout<<r/x+1;
    else cout<<r/x-(l-1)/x;
}


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

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

  if (x >=400 && x <=599) {
    cout << 8 << endl;
  }

  if (x >=600 && x <=799) {
    cout << 7 << endl;
  }

  if (x >=800 && x <=999) {
    cout << 6 << endl;
  }

  if (x >=1000 && x <=1199) {
    cout << 5 << endl;
  }

  if (x >=1200 && x <=1399) {
    cout << 4 << endl;
  }

  if (x >=1400 && x <=1599) {
    cout << 3 << endl;
  }

  if (x >=1600 && x <=1799) {
    cout << 2 << endl;
  }

  if (x >=1800 && x <=1999) {
    cout << 1 << endl;
  }
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstring>
#include <string>
std::string s[101];
int main()
{
    for(int i=0;i<3;i++)std::cin>>s[i];
    
    for(int i=0;i<3;i++)std::cout<<s[i][i];std::cout<<std::endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

// 与えられた状態numberのdigit桁が正直者かどうかのチェック
func isHonest(number uint, digit uint) uint {
	// 1とANDを取得すると１桁目の数がとれる。桁数分ずらして比較する
	return (number >> digit) & 1
}

// 状態numberにおける正直者の数をカウント
func countHonest(n uint) uint {
	result := uint(0)
	for i := 0; n > 0; i++ {
		// 末尾が1(正直者)だったらresultに1追加する
		if (n & 1) == 1 {
			result++
		}
		n >>= 1 // 一桁ずらす
	}
	return result
}

func main() {

	// 読み込み数取得
	var count uint
	fmt.Scan(&count)

	countVoices := make([]uint, count)
	voices := make([][]uint, count)
	types := make([][]uint, count)

	// ユーザーデータ作成
	for i := uint(0); i < count; i++ {
		fmt.Scan(&countVoices[i])
		voices[i] = make([]uint, countVoices[i])
		types[i] = make([]uint, countVoices[i])

		for j := uint(0); j < countVoices[i]; j++ {
			fmt.Scan(&voices[i][j], &types[i][j])
			voices[i][j]-- // メンバーIDは-1してラベルと同じにする
		}
	}

	// 最終的な回答の初期化
	answer := uint(0)

	// bit全探索
	// 2進数を左にSビット論理シフトすると、2^S倍することに相当
	// 2 ^ ユーザー数 を計算して2bit的に全パターンを取得している
	max_loop := uint(1) << count
	for situation := uint(0); situation < max_loop; situation++ {

		// 発言に齟齬があるかチェックするフラグ
		ok := true

		// ユーザー数分チェックする
		for member := uint(0); member < count; member++ {

			// ユーザーが正直じゃない（嘘つき）だったら何もせずループさせる
			if isHonest(situation, member) == 0 {
				continue
			}
			// ユーザー毎の発言をチェックしていく,一回でも発言に齟齬があったら
			for k := uint(0); k < countVoices[member]; k++ {

				// チェックの状況と発言が違っている場合は何もせずにループさせる
				if isHonest(situation, uint(voices[member][k])) != types[member][k] {
					ok = false
					break
				}
			}
			if !ok {
				break
			}
		}
		// 正直者回答者をカウントする。今まで保存しているものよりも正直ものが多かったら入れ替える
		if newAnswer := countHonest(situation); ok && newAnswer > answer {
			answer = newAnswer
		}
	}

	// 解答表示
	fmt.Printf("%d", answer)

}


Measured memory_bytes: 512
def makeSet(x):
    global p, rank
    p[x] = x
    rank[x] = 0

def union(x,y):
    link(findSet(x), findSet(y))

def link(x, y):
    global p, rank
    if(rank[x] > rank[y]):
        p[y] = x
    else:
        p[x] = y
        if(rank[x] == rank[y]):
            rank[y] = rank[y] + 1

def findSet(x):
    global p
    if(x != p[x]):
        p[x] = findSet(p[x])
    return p[x]

def isSame(x, y):
    global p
    if(findSet(x) == findSet(y)):
        return True
    else:
        return False

if __name__ == "__main__":
    N, Q = (int(z) for z in input().split())
    p = [None] * N
    rank = [None] * N

    for i in range(N):
        makeSet(i)

    for i in range(Q):
        com_i, x, y = (int(z) for z in input().split())
        if(com_i == 0):
            #print("union")
            union(x, y)
        if(com_i == 1):
            #print("isSame")
            if(isSame(x, y) == False):
                print("0")
            else:
                print("1")



Measured memory_bytes: 6044
#include <bits/stdc++.h>
#include<math.h>
#include<queue>
#include<cstdio>
#include<set>
#include<map>
using namespace std;
using ll = long long;

int main(){
    ll N,K;
    cin >> N >> K;
    ll INF=1000000007;
    ll sum=0;
    for(ll i=K; i<=N+1; i++){
        ll a=i*(N+1-i)+1;
        ll b=a%INF;
        sum += b;
        sum %= INF;
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3676
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string sS = Console.ReadLine().Trim();

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            string sOut = "None";
            for (int i = 'a'; i <= 'z'; i++)
            {
                if (!sS.Contains((char)i)) { sOut = ((char)i).ToString(); break; };
            }

            //出力
            Console.WriteLine("{0}", sOut.ToString().Trim());
            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }
}


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

using namespace std;

#define ALL(x) x.begin(), x.end()

typedef long long int lld;
typedef pair<int, int> pii;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(15);
	cout << fixed;

	string str;
	cin >> str;

	vector<pii> seg;
	
	int r = 0, l = 0;
	for (auto &c : str) {
		if (c == 'R'){
			if (l)
				seg.emplace_back(1, l);
			r++;
			l = 0;
		} else if (c == 'L') {
			if (r)
				seg.emplace_back(2, r);
			l++;
			r = 0;
		}
	}

	seg.emplace_back(1, l);

	bool first = true;

	for (int i = 0; i < (int)seg.size(); i += 2) {
		pii p1 = seg[i];
		pii p2 = seg[i + 1];

		int s = p1.second + p2.second;

		for (int j = 0; j < p1.second - 1; j++) {
			if (!first)
				cout << ' ';
			cout << 0;
			first = false;
		}

		if (s % 2 == 0) {
			l = s / 2, r = s / 2;
		} else {
			l = s - s / 2;
			r = s - l;

			// RRRLL
			// 01220
			// 00320

			// RLL
			// 120
			// 210

			if (p1.second > p2.second && p1.second % 2 == 0)
				swap(l, r);
			else if (p2.second > p1.second && p2.second % 2 == 1)
				swap(l, r);
			
		}

		if (!first)
			cout << ' ';
		cout << l << ' ' << r;
		
		for (int j = 0; j < p2.second - 1; j++)
			cout << ' ' << 0;

		first = false;
	}	

	cout << '\n';

	return 0;
}

Measured memory_bytes: 1480
#include<iostream>
using namespace std;
	
long long dp[100010][4] = {};
int main(){
	string S;
	cin >> S;
	int N=S.size(), MOD = 1000000007;

	//long long dp[100010][4] = {};
	for(int i=N;i>=0;i--){
		for(int j=3;j>=0;j--){
			if(i==N){
				dp[i][j]=(j==3 ? 1 : 0);
			}else{
				dp[i][j]=dp[i+1][j]*(S[i]=='?' ? 3LL : 1LL);
				if(j<3 && (S[i]=='?' || S[i]=="ABC"[j])){
					dp[i][j]+=dp[i+1][j+1];
				}
				dp[i][j]%=MOD;
			}
		}
	}
	cout << dp[0][0] << endl;
}


Measured memory_bytes: 3584