akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <array>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional> // greater など
#include <cmath>      // abs など
#include <numeric>    // accumulate, gcd など
#include <cassert>    // assert
#include <stdexcept>
#include <bitset>
using namespace std;

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

// GCC, 配列のアクセスなど
#define _GLIBCXX_DEBUG
// Clang, 配列のアクセスなど
#define _LIBCPP_DEBUG 0

//////////////// //////////////// //////////////// //////////////// ////////////////
//////////////// //////////////// //////////////// //////////////// ////////////////

// constexpr inline ll mod = 1'000'000'007;
// constexpr int max_n = 200'000 + 5;

int main()
{
    // 高速な入出力
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << setprecision(15); // 浮動小数の表示の精度

    int n,k; cin>>n>>k;
    vector<bool> good(n, false);
    rep(i,k) {
        int d; cin>>d;
        rep(j,d) {
            int a; cin>>a;
            a--; good[a] = true;
        }
    }
    int cnt = 0;
    rep(i,n) {
        if (!good[i]) {
            cnt++;
        }
    }
    cout << cnt << '\n';

    return 0;
}


Measured memory_bytes: 3584
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(a-1):
     if i != 0:
          if b[i-1] < b[i] and b[i] < b[i+1]:
               c += 1
          if b[i-1] > b[i] and b[i] > b[i+1]:
               c += 1
print(c)


Measured memory_bytes: 3060
#include <string>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n,h[100005];
ll dp[100005];
char color[500][500];
int a_search(int i, int j);
int colm,row;
  
int main()  {

  std::vector<int> a(3);
  // 空白文字で区切られた数字を 3 つ取得
  for(int j=0;j<3;j++){
	
   std::cin >> a[j];
   //printf("%d",a[j]);
  }
  int max,max_cnt;
  max = 0;
  max_cnt=0;
  int flg;
  flg=0;
  int teihen,takasa;
  teihen=0;
  takasa=0;
  for (int i = 0;i<3;i++){
	  if(max < a[i]){
		max=a[i];
		max_cnt=i;
	  }	
	  
  }
  for (int k = 0;k<3;k++){
      if(k!=max_cnt){
       if(flg==0){
	  	teihen = a[k];
		flg=1;
	   }
  	  else{
		takasa = a[k];
	  }
    	}
	}
	//printf("%d",teihen);
	//printf("%d",takasa);
	int ans;
	ans = teihen*takasa/2;
   printf("%d",ans);
  
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
  string str;
  int a,b;
  int sum,src;
  for(int i=0;i<9;i++){
    cin>>str>>a>>b;
    sum=a+b;
    src=200*a+300*b;
    cout<<str<<" "<<sum<<" "<<src<<endl;
  }
  return 0;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


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

  string a,b,c;
  cin >> a >> b >> c;
  char A= a[0]-0x20;
  char B= b[0]-0x20;
  char C= c[0]-0x20;
    
  cout << A << B << C <<endl;
  

  return 0;
    

}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"bufio"
	"os"
	"strings"
)

func main() {

	line := bufio.NewScanner(os.Stdin)
	line.Scan()
	str := line.Text() 
	rstr := []rune(str)

	for _, char := range rstr {
		//fmt.Println(string(char))
		if char>=65 && char<=90 {
			fmt.Print(strings.ToLower(string(char)))
		} else if char>=97 && char<=122 {
			fmt.Print(strings.ToUpper(string(char)))
		} else {
			fmt.Print(string(char))
		}
	}
	fmt.Println()
}


Measured memory_bytes: 1132
#include <bits/stdc++.h>
#define int long long
#define all(c) (c).begin(),(c).end()
#define pii pair<long long,long long>
#define endl '\n'

using namespace std;

signed main(){
    std::ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    int ans=n*(n-1)/2+m*(m-1)/2;
    cout << ans;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main
{
	private static int calcDebt(int debt,int n)
	{
		if(n==0){
			return debt;
		}else{
			int nextdebt=(int)(debt*1.05);
			int rest=nextdebt%1000;
			if(rest==0){
				return calcDebt(nextdebt,n-1);
			}else{
				return calcDebt((nextdebt/1000)*1000+1000,n-1);
			}
		}
	}
	
	public static void main(String[] args)
	{
		int n;
		Scanner scan=new Scanner(System.in);
		n=scan.nextInt();
		scan.close();
		System.out.println(calcDebt(100000,n));
	}
}

Measured memory_bytes: 26016
#include <bits/stdc++.h>
    using namespace std;
     
    int n, k;
    int a[200010];
    int c[200010] = {};
    int x = 0;
    int main()
    {
        cin >> n >> k;
        for(int i = 0; i < n; i++)
        {
            cin >> a[i];
            c[a[i]] = c[a[i]] + 1;
        }
        
        sort(c, c+200010);
        
        for(int i = 0; i < k; i++)
        {
            x = x + c[200009 - i];
        }
        
        cout << n - x << endl;
    }

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define range(i, l, r) for(int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

lint pow(lint num, lint e, lint MOD) {
    lint res = 1;
    lint cur_num = num;
    while (e) {
        if (e & 1) {
            res *= cur_num;
            res %= MOD;
        }
        cur_num *= cur_num;
        cur_num %= MOD;
        e >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    lint K, S;
    cin >> K >> S;
    lint num_combinations = 0;
    range(X, 0, K + 1) range(Y, 0, K + 1) {
        if (X + Y <= S && S - (X + Y) <= K) num_combinations += 1;
    }
    cout << num_combinations << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007
int main() {
    string s;
    cin >> s;
    int n = s.size();
    int g = 0, p = 0;
    string t = "";
    for(int i = 0; i < n; i++) {
        if(p == g) {
            t += "g";
            g++;
        } else {
            if(s[i] == 'p') {
                t += "p";
                p++;
            } else {
                t += 'p';
                p++;
            }
        }
    }
    int ans = 0;
    for(int i = 0; i < n; i++) {
        if(s[i] == 'g' && t[i] == 'p') {
            ans++;
        }
        if(s[i] == 'p' && t[i] == 'g') {
            ans--;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
N = int(input())

freq_sorted_word = {}
for i in range(N):
    sorted_word = ''.join(sorted(input()))
    freq_sorted_word.setdefault(sorted_word, 0)
    freq_sorted_word[sorted_word] += 1

def pair_num(n):
    return (n * (n - 1)) // 2

print(sum(map(pair_num, freq_sorted_word.values())))


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

int gcd(int a, int b)
{
    int r;

    if (a > b)
    {
        while ((r = a % b))
        {
            a = b;
            b = r;
        }

        return b;
    }
    else
    {
        while ((r = b % a))
        {
            b = a;
            a = r;
        }

        return a;
    }
}

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

    int k, sum = 0, i, j, l, n;
    cin >> k;

    for (i = 1; i <= k; ++i)
    {
        for (j = 1; j <= k; ++j)
        {
            for (l = 1; l <= k; ++l)
            {
                n = gcd(j, l);
                sum += gcd(i, n);
            }
        }
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 3616
#include <cstdio>
#include <vector>
#include <algorithm>

template<bool SORT = true>
std::vector<long long> divisor(long long n)
{
  std::vector<long long> r;
	for(long long i = 1; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			r.emplace_back(i);
			if (i * i != n) r.emplace_back(n / i);
		}
	}
	if (SORT) std::sort(r.begin(), r.end());
	return r;
}

int main()
{
  long long n;
  scanf("%lld", &n);
  auto v = divisor(n);
  long long ans = 1e18;
  for (auto d : v)
  {
    if (ans > (d - 1) + (n / d - 1))
    {
      ans = (d - 1) + (n / d - 1);
    }
  }
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
typedef pair <int,int> ii;
typedef long long LL;
#define pb push_back
const int INF = 2147483647;
const int MOD = 1000000007;
const int N = 1006;

int n, m, tab[N][N], res[N][N], i, j;
char t[N];

int main() {
scanf("%d %d", &n, &m);
for (i=0;i<n;i++) {
	scanf("%s", t);
	for (j=0;j<m;j++) tab[i][j] = (t[j] == '.');
}
res[0][0] = 1;
for (i=0;i<n;i++) for (j=0;j<m;j++) if (i + j > 0) {
	res[i][j] = 0;
	if (!tab[i][j]) continue;
	if (i > 0) res[i][j] = (res[i][j] + res[i - 1][j]) % MOD;
	if (j > 0) res[i][j] = (res[i][j] + res[i][j - 1]) % MOD;
}
printf("%d\n", res[n - 1][m - 1]);
return 0;
}

Measured memory_bytes: 8192
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		int gojyu = 50;
		int hyaku = 100;
		int gohyaku = 500;
		int count = 0;

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();

		for (int i1 = 0; i1 <= A; i1++) {

			for (int i2 = 0; i2 <= B; i2++) {

				for (int i3 = 0; i3 <= C; i3++) {

					if (X - (i3 * gojyu + i2 * hyaku + i1 * gohyaku) == 0) {

						count++;

					}

				}

			}

		}

		System.out.println(count);
		sc.close();
	}
}

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

const int N = 205;

int n, a[N];

vector<int> ans;

void op (int X) {
	ans.push_back(X);
	for(int i=X;i<n;i++) {
		swap(a[i], a[i-X]);
	}
}

int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;i++) {
		scanf("%d",&a[i]);
	}
	while(a[n-1] != 0) {
		op(1);
	}
	for(int i=1;i<n;i++) {
		while(a[n-1] != i) {
			op(1);
		}
		while(a[n-2] != i-1) {
			op(n-1);
			op(1);
		}
	}
	printf("%d\n",(int)ans.size());
	for(auto &T : ans) {
		printf("%d\n",T);
	}
}


Measured memory_bytes: 892
X, Y = [int(s) for s in input().split()]
money = 0
if X == 1:
  money += 300000
elif X == 2:
  money += 200000
elif X == 3:
  money += 100000
if Y == 1:
  money += 300000
elif Y == 2:
  money += 200000
elif Y == 3:
  money += 100000
if X == 1 and Y == 1:
  money += 400000
  
print(money)

Measured memory_bytes: 3064
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int a,b,c,d;
    while(~scanf("%d%d%d%d",&a,&b,&c,&d))
    {
        if(b<a)
        printf("%d\n",b*c+(a-b)*d);
        else
        printf("%d\n",a*c);
    }
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=(ll)1e9+7;
//const ll MOD=(ll)998244353;
const ll INF=(ll)1e18+10;
const double PI = 2.0*acos(0);
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; }
int dy[]={-1,1,0,0};
int dx[]={0,0,-1,1};

void solve(int ca){
    int a;
    cin>>a;
    int cnt=1;
    while(cnt*a%360!=0){
        cnt++;
    }
    cout<<cnt<<endl;
}

//#define MULTI
int main() {
#ifdef MULTI
    int N; cin>>N;
    for (int i = 0; i < N; ++i) {
        solve(i+1);
    }
#else
    solve(0);
#endif
    return 0;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,res;
	scanf("%d",&n);
	string a,b;
	cin>>a>>b; 
	for(int i=0;i<=n;i++)
	if(a.substr(n-i,i)==b.substr(0,i))
	res=i;
	cout<<n*2-res;
	return 0; 
} 

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <map>

std::map<std::string, int> count;

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int n;
    std::cin >> n;

    for (int i = 0; i < n; ++i)
    {
        std::string result;
        std::cin >> result;
        count[result] += 1;
    }

    std::cout << "AC x " << count["AC"] << "\n";
    std::cout << "WA x " << count["WA"] << "\n";
    std::cout << "TLE x " << count["TLE"] << "\n";
    std::cout << "RE x " << count["RE"];
}

Measured memory_bytes: 3228
#include<iostream>
#include<vector>
#include<algorithm>
#include <string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>

#define ok printf("ok\n");
#define MAX 1000000
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(g);(i)--)
#define all(a) (a).begin(),(a).end()
#define pb push_back

using namespace std;

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;

int main()
{
	int x,y,ans = 0,cal;
	string s,t;
	vi v,w;
	cin >>x;
	ans=(24-x)+24;

	cout <<ans;
	
	return 0;
}

Measured memory_bytes: 256
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val D, N = sc.nextInt()
  val s: Stream[Long] = math.pow(100, D).toLong #:: s.map { n => n + math.pow(100, D).toLong }  
  println(s.filter(x => x.toDouble / 100 != math.pow(100, D)).take(N).last)
}


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

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

    bool ans=false;

    int N1,N2,N3,N4;
    N4=N%10;
    N3=N/10%10;
    N2=N/100%10;
    N1=N/1000%10;

    if(N1==N2&&N2==N3&&N3==N4)
        ans=true;
    else{
        if(N1==N2&&N2==N3)
            ans=true;
        if(N2==N3&&N3==N4)
            ans=true;
    }
    cout<<(ans?"Yes":"No")<<endl;

    return 0;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 

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

LL lcm(LL a, LL b){
    LL g = gcd(a,b);
    return a/g *b;
}



int main(){
    LL A,B,C;
    cin >> A >> B >> C;
    LL num=0;
    LL res=0;
    if(B<=C){
    num+=B*2;
    C=C-B;
    }
    else{
        num+=B+C;
        C=C-B;
    }
    if(C>0){
        if(A>=C){
            num+=C;
        }
        else{
            res=C-A;
            num+=A+1;
        }
    }
    cout << num;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define eFOR(i,a,n) for(int i=(a);i<=(n);++i)
#define rFOR(i,a,n) for(int i=(n)-1;i>=(a);--i)
#define erFOR(i,a,n) for(int i=(n);i>=(a);--i)
#define each(i, a) for(auto &i : a)
#define SORT(a) sort(a.begin(),a.end())
#define rSORT(a) sort(a.rbegin(),a.rend())
#define fSORT(a,f) sort(a.begin(),a.end(),f)
#define all(a) a.begin(),a.end()
#define out(y,x) ((y)<0||h<=(y)||(x)<0||w<=(x))
#define tp(a,i) get<i>(a)
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define elif else if
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }
template<class T>inline void print(const T& a) { cout << a << "\n"; }
template<class T, class... Ts>inline void print(const T& a, const Ts&... ts) { cout << a << " "; print(ts...); }
template<class T>inline void print(const vector<T>& v) { for (int i = 0; i < v.size(); ++i)cout << v[i] << (i == v.size() - 1 ? "\n" : " "); }
template<class T>inline void print(const vector<vector<T>>& v) { for (auto& a : v)print(a); }
inline string reversed(const string& s) { string t = s; reverse(all(t)); return t; }

int main() {
    init();

    int n; cin >> n;
    VI a(n); cin >> a;
    SORT(a);
    ll ans = 0;
    FOR(i, 0, n) {
        auto it = a.begin() + i + 1;
        FOR(j, i + 1, n) {
            ans += lower_bound(all(a), a[i] + a[j]) - max(upper_bound(all(a), a[j] - a[i]), ++it);
        }
    }
    print(ans);

    return 0;
}

Measured memory_bytes: 3660
import sys
from bisect import bisect_left

readline = sys.stdin.readline
N = int(readline())
a = [int(readline()) for _ in [0]*N]
inf = float("inf")
dp = [inf]*N

for num in a:
    dp[bisect_left(dp, num)] = num

for i, num in zip(range(N, 0, -1), dp[::-1]):
    if num < inf:
        print(i)
        break

Measured memory_bytes: 13112
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input;

		while ((input = br.readLine()) != null) {
			char[] charArr = input.toCharArray();

			for (int i = 1; i <= 26; i++) {
				for (int j = 0; j < charArr.length; j++) {
					if (!isSpecialChar(charArr[j])) {
						int index = charArr[j] - 'a' + 1;
						index -= index >= 26 ? 26 : 0;
						charArr[j] = (char)('a' + index);
					}else{
						continue;
					}
				}

				String str = String.valueOf(charArr);
				boolean hasTHE = (str.indexOf("the") != -1) ? true : false;
				boolean hasTHAT = (str.indexOf("that") != -1) ? true : false;
				boolean hasTHIS = (str.indexOf("this") != -1) ? true : false;

				if(hasTHE || hasTHAT || hasTHIS){
					System.out.println(str);
				}
 			}
		}
	}

	private static boolean isSpecialChar(char c) {
		Character ch = Character.valueOf(c);
		Character sp = Character.valueOf(' ');
		Character dot = Character.valueOf('.');
		return (ch.equals(sp) || ch.equals(dot));
	}
}

Measured memory_bytes: 17956
#include <cstdio>
#include <queue>
#include <vector>
const int INFN = 1e9+7;
const int MAXK = 3;
const int MAXN = 1e5+5;
std::vector<int> G[MAXN];
int D[MAXN][MAXK];
int M, N, S, T;

template <typename T>
using min_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

struct Triple {
  int dist, node, state;

  bool operator > (const Triple& o) const {
    return dist > o.dist;
  }
};

int solve() {
  for (int i = 1; i <= N; ++i) {
    for (int j = 0; j < MAXK; ++j) {
      D[i][j] = INFN;
    }
  }
  min_heap<Triple> pq;
  D[S][0] = 0;
  pq.push(Triple{D[S][0], S, 0});
  while (!pq.empty()) {
    Triple cur = pq.top();
    pq.pop();
    if (cur.dist > D[cur.node][cur.state]) {
      continue;
    }
    int nst = (cur.state + 1) % MAXK;
    for (int nxt: G[cur.node]) {
      if (D[nxt][nst] > D[cur.node][cur.state] + 1) {
        D[nxt][nst] = D[cur.node][cur.state] + 1;
        pq.push(Triple{D[nxt][nst], nxt, nst});
      }
    }
  }
  if (D[T][0] == INFN) {
    D[T][0] = -1;
  } else {
    D[T][0] /= MAXK;
  }
  return D[T][0];
}

int main() {
  scanf(" %d%d", &N, &M);
  for (int i = 0; i < M; ++i) {
    int u, v;
    scanf(" %d%d", &u, &v);
    G[u].push_back(v);
  }
  scanf(" %d%d", &S, &T);
  printf("%d\n", solve());
  return 0;
}

Measured memory_bytes: 6912
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(N: int, A: int):
    print( YES if N % 500 <= A else NO )
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    solve(N, A)

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,x,y;
	cin>>n>>x>>y;
	int cnt=0;
	for(int i=0;i<n;i++){
		int a,b;
		cin>>a>>b;
		if((a>=x&&b>=y))
			cnt++;
	}
	cout<<cnt<<endl;
}

Measured memory_bytes: 256
def examA():
    N = I()

    ans = 0
    print(ans)
    return

def examB():
    N, M = LI()
    A = LI()
    S = sum(A)
    if N>=S:
        ans = N-S
    else:
        ans = -1
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(readline())
def LI(): return list(map(int,readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 78284
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int a = scanner.nextInt(), b = scanner.nextInt();
			System.out.println(((1 == (a & 1)) && (1 == (b & 1))) ? "Yes" : "No");
		}
	}
}


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

#define MOD 1000000007

int main()
{
    int n, k;
    scanf("%d %d", &n, &k);
    vector<long long> b, c;
    for (int i = 0; i < n; i++)
    {
        long long a;
        scanf("%lld", &a);
        if (a >= 0) b.emplace_back(a);
        else c.emplace_back(a);
    }
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());
    long long r = 1;
    if (c.size() == n && k % 2 == 1)
    {
        for (int i = 0; i < k; i++)
        {
            r = r * (c[n - 1 - i] + MOD) % MOD;
        }
    }
    else if (k == n)
    {
        for (auto& i : b) r = r * i % MOD;
        for (auto& i : c) r = r * (i + MOD) % MOD;
    }
    else
    {
        int p = b.size() - 1;
        int q = 0;
        if (k % 2 == 1)
        {
            r = b[p];
            p--;
            k--;
        }
        while (k)
        {
            long long x = -1;
            long long y = -1;
            if (p > 0) x = (b[p] * b[p - 1]);
            if (q + 1 < c.size()) y = (c[q] * c[q + 1]);
            if (x > y)
            {
                r = x % MOD * r % MOD;
                p -= 2;
            }
            else
            {
                r = y % MOD * r % MOD;
                q += 2;
            }
            k -= 2;
        }
    }
    printf("%lld\n", r);
    return 0;
}

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

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

    vector<char> a(9);
    for(int i=0; i<m; i++) {
        int x;
        cin >> x;
        a[x-1] = 1;
    }

    vector<int> mp = {2,5,5,4,5,6,3,7,6};

    vector<int> dp(n+30,-1e7);
    dp[0] = 0;
    for(int i=0; i<n; i++) {
        for(int j=0; j<10; j++) {
            if(a[j])
                dp[i+mp[j]] = max(dp[i]+1, dp[i+mp[j]]);
        }
    }

    long d = dp[n];
    for(int i=n; i>0;)
        for(int j=9; j>=0; j--) {
            if(a[j] && i-mp[j] >= 0) {
                if(dp[i-mp[j]] + 1 == dp[i]) {
                    cout << j+1 << flush;
                    i = i-mp[j];
                    break;
                }
            }
        }
    cout << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  char str[21];
  int i;
  scanf("%s", str);
  i = 0;
  while(str[i] != '\0'){
  i++;
  }
  while(i != 0){
  printf("%c", str[i-1]);
  i--;
  }
  printf("\n");
  return (0);
}

Measured memory_bytes: 0
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())
    sushi = sum(a)
    coll = collections.Counter(a)
    for _ in range(q):
        bef, aft = map(int, input().split())
        sushi += (aft-bef)*coll[bef]
        coll[aft] += coll[bef]
        coll[bef] = 0
        print(sushi)
    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 24376
N = int(input())
if N<=9:
    print(N)
elif 10<=N and N<=99 :
    print(9)
elif 100<=N and N<=999:
    print(9+N-100+1)
elif 1000<=N and N<=9999:
    print(909)
elif 10000<=N and N<=99999:
    print(909+N-10000+1)
else :
    print(90909)

Measured memory_bytes: 9084
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int maxV = 90010;
const int maxN = 3e5+10;
const int inf = 0x3f3f3f3f;
const ll MOD = 1e9+7;
const ll INF = 1000000000000000010LL;
#define X first
#define Y second

ll a[maxN];
ll c[maxN];
ll w[maxN];
ll power(ll x,ll p)
{
	if(p == 0)
		return 1;
	ll t = power(x,p/2);
	t = t*t % MOD;
	if(p%2 == 1)
	{
		t = t*x%MOD;
	}
	return t;
}
int main() {
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	ll s = 1;
	for(int i=1;i<n;i++)
	{
		s = s*i%MOD;
	}
	for(int i=1;i<n;i++)
	{
		c[i] = a[i+1] - a[i];
	}
	w[1] = s;
	for(int i=2;i<=n-1;i++)
	{
		w[i] = w[i-1] + s*power(i,MOD-2)%MOD;
		w[i] %= MOD;
	}
	ll sum = 0;
	for(int i=1;i<n;i++)
	{
		sum += w[i] * c[i];
		sum %= MOD;
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 5120
#include <iostream>
#include <cmath>
using namespace std;
double to_rad(double k)
{
	return (M_PI * k / 180.0);
}
int main()
{
	double a, b, c, k;
	cin >> a >> b >> k;
	c = sqrt(a*a + b*b - 2*a*b*cos(to_rad(k)));
	printf("%.10lf\n", 0.5*a*b*sin(to_rad(k)));
	printf("%.10lf\n", a+b+c);
	printf("%.10lf\n", b*sin(to_rad(k)));

}




Measured memory_bytes: 3540
#include <iostream>

using namespace std;

int main(){
    string s;
    long long k;
    cin >> s >> k;

    for(int i = 0; i < min((long long)s.size(), k); i++){
        if(s[i] >= '2'){
            cout << s[i] << endl;
            return 0;
        }
    }
    cout << '1' << endl;
    return 0;
}


Measured memory_bytes: 384
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000
typedef pair<ll, ll> pll;

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

    int N;
    cin >> N;
    vector<ll> A(N), B;
    rep(i, N) { cin >> A[i]; }

    int prev = -1;
    for (int i = 0; i < N; i++) {
        if (A[i] == prev)
            continue;
        else
            B.push_back(A[i]);
        prev = A[i];
    }

    prev = B[0];
    ll judge = 0, cabu = 0, ans = 1000, last_sell = -1;
    for (int i = 1; i < B.size(); i++) {
        if (!judge && prev > B[i]) {
            prev = B[i];
        } else if (!judge && prev < B[i]) {
            cabu = ans / prev;
            ans = ans % prev;
            last_sell = prev;
            judge = 1;
        } else if (judge && prev < B[i]) {
            prev = B[i];
        } else if (judge && prev > B[i]) {
            ans += prev * cabu;
            last_sell = -1;
            judge = 0;
        }

        prev = B[i];
    }

    if (last_sell != -1) {
        ans += max(B.back() * cabu, last_sell * cabu);
    }

    cout << ans << endl;
}

Measured memory_bytes: 3636
#include <stdio.h>
int main(void)
{
  int n[5];
  int t;
  int i,j;

  for(i=0;i<5;i++)
    scanf("%d",&n[i]);

  for(i=0;i<4;i++){
    for(j=4;j>i;j--){
      if(n[j]>n[j-1]){
	t=n[j];
	n[j]=n[j-1];
	n[j-1]=t;
      }
    }
  }

  printf("%d %d %d %d %d\n",n[0],n[1],n[2],n[3],n[4]);
 
  return 0;
}

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

int main(){
	int n, K;
	int N;
	cin >> N >> K;
	long long int NN = 1000000007;
	vector<int>A(N, 0);
	for(int i = 0; i < N; i++){
		cin >> A[i];
	}
	if(!N){
		cout << 0 << endl;
		return 0;
	}
	vector< vector<int> > dp(2, vector<int>(K+1, 0));
	for(int i = 0; i <= A[0]; i++)
		dp[0][i] = 1;
	if(N == 1){
		cout << dp[0][K] << endl;
		return 0;
	}
	long long int sum = 0;
	for(int i = 0; i <= K; i++){
		dp[0][i] = (sum + dp[0][i])%NN;
		sum = dp[0][i];
	}

	for(int n = 1; n < N; n++){
		for(int k = 0; k <= K; k++){
			
			// for(int j = 0; j <= A[n]; j++){
			// 	if(j > k)
			// 		break;
			// 	sum = (sum + dp[0][k - j])%NN;
			// }
			if( k - A[n] > 0){
				if(dp[0][k] - dp[0][k - A[n] - 1] < 0){
					dp[1][k] = (NN + dp[0][k] - dp[0][k - A[n] - 1])%NN ;
				}else{
					dp[1][k] = dp[0][k] - dp[0][k - A[n] - 1];
				}
				
			}
			else
				dp[1][k] = dp[0][k];
		}
		long long int sum = 0;
		for(int k = 0; k <= K; k++){
			
				//cout << dp[1][k] << " ";
			dp[0][k] = (sum + dp[1][k])%NN;
			sum = dp[0][k];
		}
		
			//cout << endl;
	}

	cout << dp[1][K] << endl;
	return 0;
}


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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    H=I()
    ans=0
    
    def f(x):
        if x==0:
            return 0
        return f(x//2)*2 +1
    
    print(f(H))
        

main()


Measured memory_bytes: 61924
#include <bits/stdc++.h>
using namespace std;
int n,res;
string s[304];
int ok(int a, int b){
  for(int i = 0; i<n; i++)
    for(int j = 0; j<n; j++)
      if(s[(i+a)%n][(j+b)%n] != s[(j+a)%n][(i+b)%n]) return 0;
  return 1;
}
int main(){
  std::cin >> n;
  for(int i = 0; i<n; i++) std::cin >> s[i];
  for(int a = 0; a<n; a++) res+=n*ok(a,0);
  std::cout << res << '\n';
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define reprl(i, n) for(ll i = n; i >= 0; i--)
#define fori(i, m, n) for(int i = m; i < (int)n; i++)
#define forl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define all(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
const string btos(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  ll x,t;cin>>x>>t;
  ll ans=max(x-t,0LL);
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 S              PIC X(100).
01 ans            PIC X(100).

PROCEDURE DIVISION.
  ACCEPT S.
  MOVE ALL "x" TO ans(1:FUNCTION STORED-CHAR-LENGTH(S))
  DISPLAY ans(1:FUNCTION STORED-CHAR-LENGTH(ans)).
  STOP RUN.


Measured memory_bytes: 636
/*Divyam Goyal - IIT-BHU*/
#include<bits/stdc++.h>
using namespace std;

#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define bitcount    __builtin_popcountll
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define ss(x) scanf("%s",x)
#define ll long long
#define mp(a,b) make_pair(a,b)
#define F first
#define S second
#define pb(x) push_back(x)
#define MOD 1000000007
#define MAX 100005



int main()
{
    //ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	string s;
	cin>>s;
	int ans=0;
	for(int i=0;i<6;i++)
		ans+=s[i]-'0';
	cout<<ans;





    return 0;


}

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

def main():
    H, W = map(int, input().split())
    P = W+1
    A = [list(map(int, input().split())) for _ in range(H)]
    B = [list(map(int, input().split())) for _ in range(H)]
    L = 80*80
    dp = [[False]*(L+1) for _ in range((W+1)*(H+1))]
    dp[P+1][abs(A[0][0]-B[0][0])] = True
    
    for h in range(H):
        for w in range(W):
            if h == 0 and w == 0: continue
            c = abs(A[h][w] - B[h][w])
            for l in range(L-c+1):
                b1 = abs(l-c)
                b2 = abs(l+c)
                dp[(h+1)*P+w+1][l] = dp[h*P+w+1][b1] or dp[(h+1)*P+w][b1] or dp[h*P+w+1][b2] or dp[(h+1)*P+w][b2]

    for l in range(L+1):
        if dp[H*P+W][l]:
            print(l)
            break


if __name__ == "__main__":
    main()

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

int main() {
  int N,a,b,c,d;
  cin >> N;
  a = N%10;
  N = N/10;
  b = N%10;
  N = N/10;
  c = N%10;
  d = N/10;
  if (a==b && b==c)
    cout << "Yes" << endl;
  else if ( b==c && c==d )
    cout << "Yes" <<endl;
  else
    cout << "No" << endl;
    
}


Measured memory_bytes: 256
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i, n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i, n) for(ll i=(ll)(n-1);i>=0;i--)
#define FOR(i, a, b) for(ll i=(ll)(a); i<=(ll)(b); i++)
#define RFOR(i, a, b) for(ll i=(ll)(a);i>=(ll)(b); i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

signed main()
{
	ll N, K;
	cin >> N >> K;
	vector<ll> p;
	REP(i, N){
		ll a;
		cin >> a;
		p.PB(a);
	}
	ll tmp=0;
	REP(i, K){
		tmp+=p[i];
	}
	ll ans=tmp;
	FOR(i, K, N-1){
		tmp=tmp+p[i]-p[i-K];
		if(tmp>ans){
			ans=tmp;
		}
	}
	cout << fixed;
	cout << setprecision(10) << (long double)((ans+K)/2.0) << endl;
}


Measured memory_bytes: 2420
N = int(input())
S = {}
for i in range(N):
    A = input()
    if A not in S:
        S[A] = 1
    else:
        S[A] += 1
Al = ['AC','WA','TLE','RE']
for i in range(4):
    if Al[i] in S:
        print(Al[i] +' x ' + str(S[Al[i]]))
    else:
        print(Al[i] +' x 0')


Measured memory_bytes: 9204
using System;
using System.Linq;

namespace _2508
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] stations = new char[52];
            for (char i = 'a'; i <= 'z'; i++) stations[i - 'a'] = i;
            for (char i = 'A'; i <= 'Z'; i++) stations[26 + i - 'A'] = i;
            while (true)
            {
                int n = int.Parse(Console.ReadLine());
                if (n == 0) break;
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                string s = Console.ReadLine();
                for (int i = 0; i < s.Length; i++)
                {
                    int a = Array.IndexOf(stations,s[i]);
                    a += 52 - x[i % n];
                    a %= 52;
                    Console.Write(stations[a]);
                }
                Console.WriteLine();
            }
        }
    }
}


Measured memory_bytes: 10008
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
//#define all(v) v.begin(), v.end()
//bool chmin(ll & a, ll  b) { if (b < a) { a = b; return 1; } return 0; }
//bool chmax(ll & a, ll b) { if (b > a) { a = b; return 1; } return 0; }
const ll INF = 999999999999999;
const ll MOD = 1000000007;
//const ll MAX_N=500010;
ll a, b, c, d, e, f, h, k, l, m, n, p, q, r, t, w, x, y, z, ans;
int main() {
  string S;
  cin >> S;
  
  if (S[0] == S[1] && S[1]==S[2]) cout << "No" << endl;
  else cout << "Yes" << endl;
  return 0;
}

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

int main()
{
  int n;
  cin >> n;
  int a[n];
  int count = 0 , min = 0;
  for(int i = 0 ; i < n ; ++i)
  {
    cin >> a[i];
  }
  min = a[0];
  for(int i = 0 ; i < n ; ++i)
  {
    if(a[i] <= min)
    {
      min = a[i];
      count++;
    }
  }
  cout << count;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()

const int MOD = 1e9 + 7, N = 2e5 + 5;
ll fac[N], inv_fac[N];

ll bp(ll a, ll p) {
    ll r = 1;
    while (p > 0) {
        if (p & 1)
            r = r * a % MOD;
        p >>= 1;
        a = a * a % MOD;
    }
    return r;
}

ll cb(int n, int k) {
    return fac[n] * inv_fac[n - k] % MOD * inv_fac[k] % MOD;
}

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

    inv_fac[0] = fac[0] = 1;

    for (int i = 1; i < N; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv_fac[i] = bp(fac[i], MOD - 2);
    }

    int n, a, b, c;
    cin >> n >> a >> b >> c;

    ll anime = 100 * bp(100 - c, MOD - 2) % MOD,
        pa = a * bp(a + b, MOD - 2) % MOD,
        pb = b * bp(a + b, MOD - 2) % MOD;

    ll ans = 0;

    for (int i = n; i <= 2 * n - 1; i++) {
        for (int j = 0; j < 2; j++) {
            ans = (ans + 
                cb(i - 1, n - 1) 
                * bp(pa, n) % MOD
                * bp(pb, i - n) % MOD 
                * i % MOD 
                * anime) % MOD;

            swap(pa, pb);
        }
    }

    cout << ans << "\n";

    return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define LL long long int
using namespace std;

const int N = 2e5 + 5;
const int oo = 1e9;

int movex[4] = {-1, 1, 0, 0};
int movey[4] = {0, 0, -1, 1};

void solve() {
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> v(h);
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1--; y1--; x2--; y2--;
    for (auto &it : v) cin >> it;
    vector<vector<int>> reach(h, vector<int>(w, oo));
    queue<pair<int, int>> bfs;
    bfs.push({x1, y1});
    reach[x1][y1] = 0;
    while(!bfs.empty()) {
        auto now = bfs.front(); bfs.pop();
        int xx = now.first, yy = now.second;
        for (int move=0;move<4;++move) {
            for (int d=1;d<=k;++d) {
                int x = xx + movex[move] * d;
                int y = yy + movey[move] * d;
                if (x < 0 || x >= h || y < 0 || y >= w) break;
                if (v[x][y] != '.') break;
                if (reach[x][y] < reach[xx][yy] + 1) break;

                if (reach[x][y] > reach[xx][yy] + 1) bfs.push({x, y});
                reach[x][y] = min(reach[xx][yy] + 1, reach[x][y]);
            }
        }
    }
    int ans = reach[x2][y2];
    if (ans >= oo) ans = -1;
    cout << ans << '\n';
} 
int main() {
    // FASTIO;
    int t = 1;
    // cin >> t;
    while(t--) solve();
    return 0;
}

Measured memory_bytes: 12144
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
//max_element

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

	int cur = 1;
	REP(i, N)
	{
		int a;
		cin >> a;
		if (a == cur)
		{
			cur++;
		}
	}

	if (cur == 1)
		cout << -1 << endl;
	else
		cout << (N - (cur - 1)) << endl;
}



Measured memory_bytes: 256
#include<stdio.h>

int main(){
    
    int N,A,B;
    scanf("%d %d %d", &N, &A, &B);
    
    int count = 0;
    for(int i = 1; i <= N; i++){
        int num = i;
        int sum = 0;
        while(num != 0){
            sum += num % 10;
            num /= 10;
        }
        if(sum >= A && sum <= B){
            count+= i;
        }
    }
    printf("%d\n", count);
    
    return 0;
}

Measured memory_bytes: 1732
#include<bits/stdc++.h>
using namespace std;
#define MX 1000005
typedef long long ll;
#define pb push_back
#define mk make_pair
#define ff first
#define ss second
#define mem(a) memset(a,0,sizeof(a))
int a[5];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ////////////////////////////////////
    for(int i=0;i<3;i++)
    {
        cin>>a[i];
    }
    int n=3;
    sort(a,a+n);
    reverse(a,a+n);
    int x=a[0];
    x=x*10+a[1];
    x=x+a[2];
    cout<<x<<endl;
    return 0;
}


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

using namespace std;

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

  vector<int> v(n);

  int h;
  for (int i = 0; i < n; i++) {
    scanf("%d", &h);
    v[i] = h;
  }

  for (int i = n - 1; i > 0; i--) {
    if (v[i-1] > v[i]) {
      v[i-1]--;
      if (v[i-1] > v[i]) {
        cout << "No" << endl;
        return 0;
      }
    }
  }

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


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

int calc(int i){
	int ret = 0;
	while(i % 100 == 0){
		i /= 100;
		ret++;
	}
	return ret;
}

int main() {
	int D, N;
	cin >> D >> N;
	int ans = 0;
	int counter = 0;
	while(counter < N){
		ans++;
		if(calc(ans) == D){
			counter++;
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main() {
	ll n;
	while (scanf("%lld", &n), n) {
		ll sum = 0;
		rep(i, n) {
			ll x, y, h, w; scanf("%lld%lld%lld%lld", &x, &y, &h, &w);
			x += y + h;
			if (x <= 60 && w <= 2)sum += 600;
			else if (x <= 80 && w <= 5)sum += 800;
			else if (x <= 100 && w <= 10)sum += 1000;
			else if (x <= 120 && w <= 15)sum += 1200;
			else if (x <= 140 && w <= 20)sum += 1400;
			else if (x <= 160 && w <= 25)sum += 1600;
		}
		printf("%lld\n", sum);
	}
}

Measured memory_bytes: 3224
#!/usr/bin/python
import sys

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a,b):
    return a / gcd(a,b) * b

for l in sys.stdin:
    a = [int(s) for s in l.split()]
    print str(gcd(a[0],a[1]))+" "+str(lcm(a[0],a[1]))

Measured memory_bytes: 4232
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()
 
int main(){
	ll a, b;
    cin>>a>>b;
    if((a+b)>=24)cout<<(a+b)-24<<endl;
    else cout<<(a+b)<<endl;
	return 0;
}

Measured memory_bytes: 256