akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<utility>
using namespace std;
const int MAX = 36;
void bubbleSort(pair<char, int> A[], int n)
{
	for (int i = 1; i <= n - 1; i++)
		for (int j = i - 1; j >= 0; j--)
			if (A[j + 1].second < A[j].second)
				swap(A[j + 1], A[j]);
}
void selectionSort(pair<char, int> A[], int n)
{
	for (int i = 0; i <= n - 1; i++)
	{
		int min = i;
		for (int j = i; j <= n - 1; j++)
			if (A[j].second < A[min].second)
				min = j;
		if (min != i)
			swap(A[i], A[min]);
	}
}
bool isStable(const pair<char, int> A[], const pair<char, int> B[],int n)
{
	for (int i = 0; i < n; i++)
		if (A[i].first != B[i].first)
			return false;
	return true;
}
void print(const pair<char, int> A[], int n)
{
	for (int i = 0; i < n; i++)
		if (i != n - 1)
			cout << A[i].first << A[i].second << " ";
		else
			cout << A[i].first << A[i].second << endl;
}
int main()
{
	pair<char, int> card1[MAX],card2[MAX];
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> card1[i].first >> card1[i].second;
		card2[i] = card1[i];
	}
	bubbleSort(card1, n);
	print(card1, n);
	cout << "Stable\n";
	selectionSort(card2, n);
	print(card2, n);
	cout << (isStable(card1, card2, n) ? "Stable" : "Not stable") << endl;
}


Measured memory_bytes: 3072
# pragma comment(linker, "/STACK: 2000000")
# include <stdio.h>
# include <bits/stdc++.h>
using namespace std;
# define fi cin
# define fo cout
# define x first
# define y second
# define ll long long
# define IOS ios_base :: sync_with_stdio(0);cin.tie(0)
# define p(v) cerr << #v << " = " << v << '\n';
# define p2(v) cerr << #v << " = " << (complex < int > (v.x,v.y)) << '\n'
# define vi vector < int >
# define vll vector < ll >
# define pii pair < int , int >
const int dx[] = {0,0,-1,1};
const int dy[] = {-1,1,0,0};
char c[1 << 10][1024];
char a[1024][1024];
char b[1024][1024];
int main(void)
{
    #ifdef CF
    freopen("input","r",stdin);
    #endif // CF
    srand(time(0));
    fo << fixed << setprecision(7);
    cerr << fixed << setprecision(7);
    int n,m;
    fi>>n>>m;
    for (int i = 1;i <= n;++i)
        fi>>(c[i] + 1);
    auto conected = [&](auto c)
    {
        static int was[512][512];
        memset(was,0,sizeof(was));
        for (int i = 1;i <= n;++i)
            for (int j = 1;j <= m;++j)
                if (c[i][j] == '#' && !was[i][j])
                {
                    queue < pair < int , int > > Q;
                    Q.push({i,j});
                    was[i][j] = 1;
                    while (!Q.empty())
                    {
                        pair < int , int > node = Q.front();
                        Q.pop();
                        for (int k = 0;k < 4;++k)
                        {
                            pair < int , int > Next = {node.x + dx[k],node.y + dy[k]};
                            if (c[Next.x][Next.y] == '#' && !was[Next.x][Next.y])
                                was[Next.x][Next.y] = 1,Q.push(Next);
                        }
                    }
                    for (int i = 1;i <= n;++i)
            for (int j = 1;j <= m;++j)
                if (c[i][j] == '#' && !was[i][j])
                    return 0;
                    return 1;
                }
        return 1;
    };
    for (int i = 1;i <= n;++i)
        for (int j = 1;j <= m;++j)
            a[i][j] = (c[i][j] == '#' || (((i&1) || j == 1) && j != m) ? '#' : '.');
    assert(conected(a));
    for (int i = 1;i <= n;++i)
        for (int j = 1;j <= m;++j)
            b[i][j] = (c[i][j] == '#' || ((!(i&1) || j == m) && j != 1) ? '#' : '.');
    assert(conected(b));
    for (int i = 1;i <= n;++i)
        fo << (a[i] + 1) << '\n';
    fo << '\n';
    for (int i = 1;i <= n;++i)
        fo << (b[i] + 1) << '\n';
    return 0;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
P dp_min[105][205][205];
P dp_max[105][205][205];
bool used[105][205][205];
vector<int> val;
vector<int> G[105];
int p[205];

struct data{
	int a,b,cnt,st;
	data(){}
	data(int aa,int bb,int cc,int ss){
		a=aa;
		b=bb;
		cnt=cc;
		st=ss;
	}
};

void solve(int v,int l,int r){
	if(used[v][l][r])return;
	//printf("%d %d %d\n",v,l,r);
	used[v][l][r]=true;
	if(G[v].size()==0){
		int pos=lower_bound(val.begin(),val.end(),p[v])-val.begin();
		dp_min[v][l][r]=P(1,pos);
		dp_max[v][l][r]=P(1,pos);
		//printf("%d %d\n",v,val[pos]);
		return;
	}
	int ord[5];
	for(int i=0;i<G[v].size();i++){
		ord[i]=i;
	}
	dp_min[v][l][r]=P(114514,114514);
	do{
		queue<data> que;
		que.push(data(l,r,0,0));
		while(que.size()){
			data d=que.front();
			que.pop();
			if(d.st==G[v].size()){
				dp_min[v][l][r]=min(dp_min[v][l][r],P(d.cnt,d.a));
				dp_max[v][l][r]=max(dp_max[v][l][r],P(d.cnt,d.a));
				continue;
			}
			int nv=G[v][ord[d.st]];
			int ra=lower_bound(val.begin(),val.end(),-val[d.a])-val.begin();
			int rb=lower_bound(val.begin(),val.end(),-val[d.b])-val.begin();
			solve(nv,rb,ra);
			int rpos=lower_bound(val.begin(),val.end(),-val[dp_min[nv][rb][ra].second])-val.begin();
			if(rpos>=d.b){
				dp_min[v][l][r]=min(dp_min[v][l][r],P(d.cnt+dp_min[nv][rb][ra].first,rpos));
				dp_max[v][l][r]=max(dp_max[v][l][r],P(d.cnt+dp_min[nv][rb][ra].first,rpos));	
			}else{
				que.push(data(max(d.a,rpos),d.b,d.cnt+dp_min[nv][rb][ra].first,d.st+1));
			}
			rpos=lower_bound(val.begin(),val.end(),-val[dp_max[nv][rb][ra].second])-val.begin();
			if(rpos>=d.b){
				dp_min[v][l][r]=min(dp_min[v][l][r],P(d.cnt+dp_max[nv][rb][ra].first,rpos));
				dp_max[v][l][r]=max(dp_max[v][l][r],P(d.cnt+dp_max[nv][rb][ra].first,rpos));	
			}else{
				que.push(data(max(d.a,rpos),d.b,d.cnt+dp_max[nv][rb][ra].first,d.st+1));
			}
		}
	}while(next_permutation(ord,ord+G[v].size()));
	//printf("%d %d %d (%d,%d) (%d,%d)\n",v,l,r,dp_min[v][l][r].first,val[dp_min[v][l][r].second],dp_max[v][l][r].first,val[dp_max[v][l][r].second]);
}

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&p[i]);
		val.push_back(p[i]);
		val.push_back(-p[i]);
	}
	val.push_back(114514);
	val.push_back(-114514);
	sort(val.begin(),val.end());
	val.erase(unique(val.begin(),val.end()),val.end());
	for(int i=0;i<n;i++){
		int k;
		scanf("%d",&k);
		for(int j=0;j<k;j++){
			int a;
			scanf("%d",&a);
			a--;
			G[i].push_back(a);
		}
	}
	solve(0,0,val.size()-1);
	printf("%d %d\n",dp_min[0][0][val.size()-1].first,dp_max[0][0][val.size()-1].first);
	return 0;
}


Measured memory_bytes: 73628
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <queue>

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
typedef double              DOUBLE;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)

#define INF 1000000001
#define MOD 1000000007
#define INF64 1000000000000000001

#define F first
#define S second

#define Pii pair<SINT32,SINT32>
#define Pll pair<SINT64,SINT64>


using namespace std;

int main() {

	SINT32 X,Y,Z;
	SINT32 cnt = 0;
	cin >> X>>Y>>Z;
	X = X-Z;
	
	while (1) {
		X -= Y+Z;
		if (X < 0) {
			break;
		}
		cnt++;
	}

	cout << cnt << endl;
	return 0;
}

//	sort(DATA.begin(),DATA.end());
//	sort(DATA.begin(),DATA.end(),std::greater<SINT32>());
//	__gcd(ANS,DATA[i]);

//	// DATA.emplace_back(BUF);	//後ろに追加

//  DATA.erase(std::unique(DATA.begin(), DATA.end()), DATA.end());	//ソート後に使用

//	DATA.insert(DATA.begin() + X, 0);	//X番目の要素に0を挿入


//	vector<vector<SINT32>> DP(N,vector<SINT32>(3));	//2次元配列

/*
	SINT32 M = 3;
	vector<pair<SINT32,SINT32>> DATA2(M);
	for (SINT32 i = 0; i < M; i++) {
		cin >> DATA2[i].first;
		cin >> DATA2[i].second;
	}
	sort(DATA2.begin(),DATA2.end());
	cout << DATA2[0].first << endl;
	cout << DATA2[0].second << endl;
*/

// 	vector<pair<int,pair<int,int>>> DATA(M);
//	cin >> DATA[i].first;
//	cin >> DATA[i].second.first;
//	cin >> DATA[i].second.second;


//		APOSI = lower_bound(ADATA.begin(),ADATA.end(),QDATA[i]) - ADATA.begin();	//key以上を探す
//		BPOSI = lower_bound(BDATA.begin(),BDATA.end(),QDATA[i]) - BDATA.begin();


/* 文字列回転
	string N;
	cin >> N;
	N = N[N.length()-1] + N.substr(0,N.length()-1);
*/
/* 文字列合成
	string N,M;
	cin >> N >> M;
	SINT64 ans = 0;
	ans = stoi(N+M);
*/



/* SET コンテナ
	set<SINT32> DATA;
	for (SINT32 i = 0; i < N; i++) {
		SINT32 buf;
		cin >> buf;
		DATA.insert(buf);
	}

	//全表示
    set<string>::iterator it; //  イテレータを用意
    for(it = DATA.begin(); it != DATA.end(); it++) {
        cout << *it << endl;
    }

	//N番目を一部表示
	set<string>::iterator it; //  イテレータを用意
	it = DATA.begin();
	rep (i,0,N) {
		it++;
	}
	cout << *it << endl;
*/

/* map
	map<string,SINT32> mp;
	SINT32 N = 0;
	SINT32 mx = 0;

	cin >> N;
	for (SINT32 i = 0; i < N; i++) {
		string s;
		cin >> s;
		mp[s]++;
	}
	for(auto it=mp.begin();it!=mp.end();it++) {
		mx=max(mx,it->second);
	}

*/

Measured memory_bytes: 256
sx, sy, tx, ty, = [int(i) for i in input().split()]
x_diff = tx - sx
y_diff = ty - sy

output = ''
# 1周目
output += 'U'*y_diff
output += 'R'*x_diff
output += 'D'*y_diff
output += 'L'*x_diff

#2周目
output += 'L'
output += 'U'*(y_diff+1)
output += 'R'*(x_diff+1)
output += 'D'
output += 'R'
output += 'D'*(y_diff+1)
output += 'L'*(x_diff+1)
output += 'U'

print(output)

Measured memory_bytes: 9104
#include <iostream>
using namespace std;
int main(){
	int a[5];
	for(int i=0;i<5;i++){
		cin>>a[i];
	}
	int b[5];
	int tmp=0;
	int minn=1000000;
	for(int i=0;i<5;i++){
		for(int j=0;j<5;j++){
			for(int k=0;k<5;k++){
				for(int l=0;l<5;l++){
					for(int m=0;m<5;m++){
						if(i!=j&&i!=k&&i!=l&&i!=m&&j!=k&&j!=l&&j!=m&&k!=l&&k!=m&&l!=m){
							tmp=0;
							b[0]=a[i];
							b[1]=a[j];
							b[2]=a[k];
							b[3]=a[l];
							b[4]=a[m];
							for(int n=0;n<4;n++){
								if(b[n]%10!=0){
									tmp=(tmp+b[n])/10*10+10;
								}else{
									tmp=tmp+b[n];
								}
							}
							tmp+=b[4];
							if(tmp<minn){
								minn=tmp;
							}
						}
					}
				}
			}
		}
	}
	cout<<minn;
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

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

        int n = Integer.parseInt(br.readLine());
        for(int x = 1 ; x <= n; x++){
        	if(x % 3 == 0){
        		System.out.print(" " + x);
        	}else {
        		Integer m = new Integer(x);
        		String k = m.toString();
        		for(int y = 0; y < k.length(); y++){
        			String str = String.valueOf(k.charAt(y));
        			if(str.equals ("3")){
        				System.out.print(" " + x);
        				break;
        			}
        		}
        	}
        }
        System.out.println();
    }
}

Measured memory_bytes: 28624
#include <algorithm>
#include <cstddef>
#include <iostream>
#include <numeric>
#include <unordered_set>

using namespace std;

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

int solve(int s) {
    auto i = 1;
    unordered_set<int> results;
    results.insert(s);
    auto next = f(s);
    while (!results.count(next)) {
        results.insert(next);
        next = f(next);
        i++;
    }
    return i + 1;
}

// Read parameters from standard input and call main solution function
int main() {
    int s;
    cin >> s;
    cout << solve(s) << endl;
    return 0;
}

Measured memory_bytes: 256
if isfile("mystdin.txt");mystdin=open("mystdin.txt","r");redirect_stdin(mystdin);end
pI(x)=parse(BigInt,x)
pM(x::Array{SubString{String},1})=map(pI,x)
function main()
  n=pI(readline())
  ans::BigInt=1
  for i=1:n
    ans=ans*i%(10^9+7)
  end
  println(ans)
end
main()
if isdefined(Base, :mystdin);close(mystdin);end


Measured memory_bytes: 172624
#include<stdio.h>
#include<stdlib.h>
#include <limits.h>  

#define WHITE 0
#define BLACK 1
#define MAX 100
#define NIL -1

int d[MAX];
int w[MAX][MAX];
int color[MAX];

int main(){

  int n,i,j,mincost,u,v,c,k,x;
  
  scanf("%d", &n);
  
  for(i = 0 ; i < n ; i++)
    for(j = 0 ; j < n ; j++)
      w[i][j] = NIL;
  
  for(i = 0 ; i < n ; i++){
    scanf("%d",&x);
    scanf("%d",&k);
    
    for(j = 0 ; j < k ; j++){
      scanf("%d",&v);
      scanf("%d",&c);
      
      w[x][v] = c;
    }
  }
  
  
  for(i = 0 ; i < n ; i++){
    d[i] = INT_MAX;
    color[i] = WHITE;
  }
  
  d[0] = 0;
  
  while(1){
    mincost = INT_MAX;

    for(i = 0 ; i < n ; i++){
      if(d[i] < mincost && color[i] == WHITE){
	mincost = d[i];
	u = i;
      }
   }
    
    if(mincost == INT_MAX) break;
    color[u] = BLACK;
    
    for(v = 0 ; v < n ; v++){
      if(w[u][v] == NIL) continue;
      if(d[v] > w[u][v] + d[u]) d[v] = w[u][v] + d[u];
      
    }
  }
  
  for(i = 0 ; i < n ; i++)
    printf("%d %d\n",i,d[i]);

return 0;

}

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

int main(){
 int arr[5];
  int ans = 0;
  for(int i = 0; i < 5; i++){
    cin >> arr[i];
    if(arr[i] == 0) ans = i;
  }
  
  cout << ans+1 << endl;
  
  return 0;
}

Measured memory_bytes: 3636
using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.IO;

class Solve
{
	const int mod = 1000000007;
	static void Main(string[] args)
	{
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
		Console.SetOut(sw);

		var p = Console.ReadLine().Split().Select(int.Parse).ToArray();
		int a = p[0];
		int b = p[1];
		string ans = "Impossible";
		if ((a * b * (a + b)) % 3 == 0) { ans = "Possible"; }
		Console.WriteLine(ans);

		Console.Out.Flush();
	}
}


Measured memory_bytes: 13396
import itertools
import math

N = int(raw_input())
l = []
for i in range(1,N+1):
  l.append(i)
p = list(itertools.permutations(l))

P = tuple(raw_input().split())
P_i = [int(s) for s in P]
P_i = tuple(P_i)
con_p = 0
for i in range(len(p)):
  if p[i] == P_i:
    con_p = i
    break

Q = tuple(raw_input().split())
Q_i = [int(s) for s in Q]
Q_i = tuple(Q_i)
con_q = 0
for i in range(len(p)):
  if p[i] == Q_i:
    con_q = i
    break
print abs(con_p-con_q)

Measured memory_bytes: 9116
MOD = 2019
s = gets.chomp.split("")
ln = s.length

mods = Array.new(ln+1, 0)
num = 0
hoge = 1
for i in 0..(ln-1)
  num = (num + s[ln-1-i].to_i * hoge) % MOD
  mods[ln-1-i] = num
  hoge = (hoge*10) % MOD
end
cmb = Array.new(MOD, 0)
mods.each{|m| cmb[m] += 1}

cnt = 0
for i in 0..(MOD-1)
  cnt += cmb[i]*(cmb[i]-1)/2 if cmb[i] > 1
end
puts cnt

Measured memory_bytes: 26480
#include<stdio.h>
int primetable[1000] = {};
int univcnt = 0;

void settable(){
  int i = 0;
  int j = 0;
  int primeflag = 0;
  for(i=2;i<=1000;i++){
    primeflag = 1;
    for(j=2;j<i;j++){
      if(i % j == 0){
        primeflag = 0;
      }
    }
    if(primeflag){
      primetable[univcnt] = i;
      univcnt++;
    }
  }
}
        
int main(){
  int n = 0;
  int primecnt[1000] = {};
  int i = 0;
  int j = 0;
  int k = 0;
  long long cnt = 1;
  scanf("%d",&n);
  settable();
  for(i=1;i<=n;i++){
    k = i;
    for(j=0;j<univcnt && k != 1;j++){
      while(k % primetable[j] == 0){
        k /= primetable[j];
        primecnt[j]++;
      }
    }
  }
  //printf("%d#",primetable[1]);
  //printf("%d#",primecnt[1]);
  for(i=0;i<univcnt;i++){
    cnt = (cnt * (primecnt[i]+1))%1000000007;
  }
  printf("%lld\n",cnt);
  
        
  return 0;
}

Measured memory_bytes: 128
package main

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

var sc = bufio.NewScanner(os.Stdin)

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}

func c(n, r int) int {
	if r > n-r {
		return c(n, n-r)
	}
	res := 1
	for i := n; i > n-r; i-- {
		res *= i
	}
	for i := r; i > 1; i-- {
		res /= i
	}
	return res
}

func main() {
	sc.Split(bufio.ScanWords)
	n, p := ri(), ri()

	ctO, ctE := 0, 0
	for i := 0; i < n; i++ {
		if ri()%2 == 0 {
			ctE++
		} else {
			ctO++
		}
	}

	e := 1 << uint(ctE)
	o := 0
	for i := 0; i+p <= ctO; i += 2 {
		o += c(ctO, i+p)
	}

	fmt.Println(e * o)
}


Measured memory_bytes: 640
import sys
msg = sys.stdin.readlines()
a = []
for x in msg:
  a.append(x.replace('\n', ''))
arra = a[1].split(' ')
arra = [int(x) for x in arra]
if len(arra) == len(set(arra)):
  print('YES')
else:
  print('NO')

Measured memory_bytes: 29020
#include <iostream>
#include <string>
#include <iomanip>
#include <math.h>
using namespace std;

int main()
{
	int x, h;
	double s;
	while (1)
	{
		cin >> x >> h;
		if ((x == 0) && (h == 0)) break;
		s = pow(x,2.0) + x* sqrt(pow(h,2.0)+pow(x,2.0)/4) *2;
		cout << fixed <<setprecision(6) << s << endl;
	}
	return 0;
}

Measured memory_bytes: 1232
// include headers{{{
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
/*}}}*/
# define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;


class UnionFind {
    public:
        // contain parent node_index
        // if the node_id is root, -size(group)
        vector<int> parent;
        long long root(int);
        long long size(int);

        // judging functions
        bool join(int, int);
        bool same(int, int);

        UnionFind(int x) {
            parent = vector<int>(x, -1);
        };

};


long long UnionFind::root(int node_id) {
    if (parent[node_id] < 0) return node_id;
    else return parent[node_id] = UnionFind::root(parent[node_id]);
}


long long UnionFind::size(int node_id) {
    return -parent[UnionFind::root(node_id)];
}


bool UnionFind::same(int source_node_id, int target_node_id) {
    return UnionFind::root(source_node_id) == UnionFind::root(target_node_id);
}


bool UnionFind::join(int source_node_id, int target_node_id) {
    int a = UnionFind::root(source_node_id);
    int b = UnionFind::root(target_node_id);
    if (a == b) return false;

    if (UnionFind::size(a) < UnionFind::size(b)) swap(a, b);
    parent[a] += parent[b];
    parent[b] = a;

    return true;
}


int main () {
    int n, m; cin >> n >> m;
    vector<int> a(m), b(m);
    rep (i, m) {
        cin >> a[i] >> b[i];
        a[i]--; b[i]--;
    }

    vector<long long> ans(m, 0);
    ans[m-1] = (long long)n*(n-1) / 2;
    UnionFind uf = UnionFind(n);
    for (int index = m-1; index>=1; index--) {
        if (uf.root(a[index]) != uf.root(b[index])) {
            ans[index-1] = ans[index] - uf.size(a[index])*uf.size(b[index]);
            uf.join(a[index], b[index]);
        } else {
            ans[index-1] = ans[index];
        }
    }

    rep (index, m) {
        cout << ans[index] << endl;
    }
    return 0;
}


Measured memory_bytes: 3328
# import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # queue
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    s = input()
    ans = 1
    t = ''
    for i in range(len(s)//2):
        t += s[i]
        if s[i]!=s[-1-i]:
            ans = 0
    if not ans:
        print("No")
        return
    u = ''
    for i in range(len(t)//2):
        u += t[i]
        if t[i]!=t[-1-i]:
            ans = 0
    if not ans:
        print("No")
    else:
        print("Yes")
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 3064
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);

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

    vector<string> s(n+1);
    s[n] = "|";
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        sort(s[i].begin(), s[i].end());
    }
    sort(s.begin(), s.end());

    ll c = 1;
    ll res = 0;
    for (int i = 1; i <= n; i++) {
        if (s[i] == s[i - 1]) {
            c++;
        }
        else {
            res += (c * 0.5) * (c - 1);
            c = 1;
        }
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 7296
from collections import deque

n, x, y = map(int, input().split())
x -= 1
y -= 1

ans = [0] * (n+1)
INF = 10 ** 10

for i in range(n):
    distance = [INF] * n
    q = deque([])
    distance[i] = 0
    q.append(i)
    while len(q) > 0:
        v = q.popleft()
        if v - 1 >= 0:
            if distance[v-1] == INF:
                q.append(v-1) 
                distance[v-1] = distance[v] + 1
        if v + 1 < n:
            if distance[v+1] == INF:
                q.append(v+1)
                d = distance[v] + 1
                distance[v+1] = distance[v] + 1
        if v == x:
            if distance[y] == INF:
                q.append(y)
                distance[y] = distance[v] + 1
        if v == y:
            if distance[x] == INF:
                q.append(x)
                distance[x] = distance[v] + 1
    for i in range(n):
        ans[distance[i]] += 1

for i in range(1, n):
    ans[i] //= 2
    print(ans[i])

Measured memory_bytes: 50140
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define p pair<int,int>
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
using namespace std;
int POW(int x,int y){return int(pow(double(x),double(y)));}



int main(){
	int n;
	cin>>n;
	int weight;
	cin>>weight;
	vector<int> w(n),v(n);
	rep(i,n){
		cin>>v[i]>>w[i];
	}
	
	vector<vector<int>> a(n);
	rep(i,n){
		a[i].resize(weight+1);
		rep(j,weight+1){
			if(i==0){
				a[0][j]=(j/w[0])*v[0];
				/*
				if(j>=w[0])a[0][j]=v[0];
				else a[0][j]=0;
				*/
			}else{
				if(j<w[i]) a[i][j]=a[i-1][j];
				else a[i][j]=max(a[i-1][j],max(a[i-1][j-w[i]]+v[i],a[i][j-w[i]]+v[i]));
			}
		}
	}
	cout<<a[n-1][weight]<<endl;
}


Measured memory_bytes: 6808
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define int long long
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
const array<pair<int,int>,4> fd{make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

signed main(){
  int n;cin>>n;int ans = 0;
  int a;
  rep(i,n){
    cin>>a;
    while(!(a%2)){
      a /= 2;ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T, typename U> using P = pair<T, U>;
using ll = int64_t;
using PLL = P<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename Head, typename... Tail> const Head& var_min(const Head &head, const Tail&... tail) { return min(head, var_min(tail...)); }
template <typename Head, typename... Tail> const Head& var_max(const Head &head, const Tail&... tail) { return max(head, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }

void init_io() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(30);
}

// #define DEBUGGING
#ifdef DEBUGGING
#include "../debug.cpp"
#else
#define DEBUG(...) 0
#endif

int main() {
    ll K;
    cin >> K;
    ll N = 50;
    V<ll> ans(N);
    iota(ALL(ans), 0ll);
    ll times = K / N;
    for(ll &e : ans) e += times;
    ll rest = K - times * N;
    for(ll loops = 0; loops < rest; loops++) {
        ans[loops] += N;
        for(ll i = 0; i < N; i++) if(i != loops) ans[i]--;
    }
    cout << ans.size() << endl;
    for(ll e : ans) cout << e << ' ';
    cout << endl;
}


Measured memory_bytes: 256
N = int(input())
a = list(map(int, input().split()))

color = set()
cnt = 0
for i in a:
  if 1 <= i <= 399:
    color.add("gray")
  elif 400 <= i <= 799:
    color.add("brown")
  elif 800 <= i <= 1199:
    color.add("green")
  elif 1200 <= i <= 1599:
    color.add("water")
  elif 1600 <= i <= 1999:
    color.add("blue")
  elif 2000 <= i <= 2399:
    color.add("yellow")
  elif 2400 <= i <= 2799:
    color.add("orange")
  elif 2800 <= i <= 3199:
    color.add("red")
  else:
    cnt += 1

print("%s %s" %(max(len(color),1), len(color) + cnt))

Measured memory_bytes: 3064
import java.util.*
import kotlin.math.absoluteValue
import kotlin.math.max

fun dfs(current: Int, next: IntArray, searched: BooleanArray, loop: MutableList<Int> = mutableListOf()): List<Int> {
    if (searched[current]) return loop
    loop.add(current)
    searched[current] = true
    return dfs(next[current], next, searched, loop)
}
fun calMaxScoreWithMaxLength(maxLength: Int, loop: List<Int>, scores: LongArray): Long {
    if (maxLength == 0) return 0L
    val queue = ArrayDeque<Pair<Int, Long>>()
    queue.addLast(-1 to 0L)
    var sum = 0L
    var result = Long.MIN_VALUE
    for (i in 0 until (loop.size shl 1)) {
        sum += scores[loop[i % loop.size]]
        while (queue.isNotEmpty() && queue.first.first + maxLength < i) {
            queue.pollFirst()
        }
        val (_, min) = queue.first
        if (result < sum - min) {
            result = sum - min
        }
        while (queue.isNotEmpty() && queue.last.second >= sum) {
            queue.pollLast()
        }
        queue.addLast(i to sum)
    }
    return result
}
fun calMaxScore(k: Int, loop: List<Int>, scores: LongArray): Long {
    return if (k >= loop.size) {
        val sum = loop.map(scores::get).sum()
        if (sum > 0) {
            val rest = k % loop.size
            val maxRest = calMaxScoreWithMaxLength(rest, loop, scores)
            val maxFull = calMaxScoreWithMaxLength(loop.size, loop, scores)
            max(sum * (k / loop.size) + maxRest, sum * (k / loop.size - 1) + maxFull)
        }else {
            calMaxScoreWithMaxLength(loop.size, loop, scores)
        }
    }else {
        calMaxScoreWithMaxLength(k, loop, scores)
    }
}
fun main() {
    val (n, k) = readLine()!!.trim().split(' ').map(String::toInt)
    val nexts = readLine()!!.trim().split(' ').map{it.toInt() - 1}.toIntArray()
    val scores = readLine()!!.trim().split(' ').map(String::toLong).toLongArray()
    val searched = BooleanArray(n){false}
    var maxScore = Long.MIN_VALUE
    for (i in 0 until n) {
        if (searched[i]) continue
        val loop = dfs(i, nexts, searched)
        val score = calMaxScore(k, loop, scores)
        maxScore = max(maxScore, score)
    }
    println(maxScore)
}

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

int main() {
  int N, M;
  cin >> N >> M;
  
  int a[M],b[M],c[N];
  
  for (int i=1; i<N+1; i++){
    c[i]=0;
  }
  
  for (int i=0; i<M; i++){
      cin >> a[i] >> b[i];
  }
  
  for (int i=0; i<M; i++){
    c[a[i]]++;
    c[b[i]]++;
  }
  
  for (int i=1; i<N+1; i++){
    cout << c[i] <<endl;
  }
}

Measured memory_bytes: 256
<?php
// B
fscanf(STDIN, '%d %d %d', $a, $b, $k);
for ($i = $a; $i <= min($a + $k - 1, $b); $i++) {
    $ans[] = $i;
}
for ($i = max($b - $k + 1, $i); $i <= $b; $i++) {
    $ans[] = $i;
}
$ans = array_unique($ans);
echo implode(PHP_EOL, $ans);

Measured memory_bytes: 4728
#include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include <tuple>
using namespace std;
//const long long INF = 10000000000;

int main(){
    int H, W;
    cin >> H >> W;

    vector<vector<int> > a(H);
    vector<tuple<int, int, int, int>> ans;
    for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++)
        {
            int s;
            cin >> s;
            a[i].push_back(s);
        }
    }

    int cnt = 0;
    for (int i = 0; i < H; i++)
    {
        if(i % 2 == 0){
            // 偶数行
            for (int j = 0; j < W; j++)
            {
                if(a[i][j] % 2 == 1){
                    a[i][j]--;
                    if(j+1 <= W-1){
                        a[i][j+1]++;
                        ans.push_back(make_tuple(i,j,i,j+1));
                        cnt++;
//                        cout << i << j << i << j+1 << endl;
                    }
                    else if(i+1 <= H-1){
                        a[i+1][j]++;
                        ans.push_back(make_tuple(i,j,i+1,j));
                        cnt++;
 //                       cout << i << j << i+1 << j << endl;
                    }
                    else break;
                }
            }
        }else{
            // 奇数行
            for (int j = W-1; j >= 0; j--)
            {
                if(a[i][j] % 2 == 1){
                    a[i][j]--;
                    if(j-1 >= 0){
                        a[i][j-1]++;
                        ans.push_back(make_tuple(i,j,i,j-1));
                        cnt++;
 //                       cout << i << j << i << j-1 << endl;
                    }
                    else if(i+1 <= H-1){
                        a[i+1][j]++;
                        ans.push_back(make_tuple(i,j,i+1,j));
                        cnt++;
//                        cout << i << j << i+1 << j << endl;
                    }
                    else break;
                }
            }
        }
    }
    cout << cnt << endl;
    for(auto x : ans){
            cout << get<0>( x )+1 << " " << get<1>( x )+1 << " " << get<2>( x )+1  << " " << get<3>( x )+1 << endl;
        }
}

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

int main(){
   long long int n;
   cin >> n;
   long long int *m;
   m = new long long int[n+1];
   for (int i=0; i<n+1; i++) {
      cin >> m[i];
   }
   long long int *y;
   y = new long long int[n];

   for (int i=0; i<n; i++) {
      cin >> y[i];
   }
   long long int retval=0;
   
   for (int i=0; i<n; i++) {
      // i
      if (y[i] <= m[i]) {
         m[i] -= y[i];
         retval += y[i];
         y[i] = 0;
//         continue;
      }else{
         retval += m[i];
         y[i] -= m[i];
         m[i] = 0;
      }
      // i+1
      if (y[i] <= m[i+1]) {
         retval += y[i];
         m[i+1] -= y[i];
         y[i] = 0;
      }else{
         retval += m[i+1];
         y[i] -= m[i+1];
         m[i+1] = 0;
      }
   }
   cout << retval << endl;
}


Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<bitset>
#include<iomanip>
#include<cctype>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
const int inf = 1001001000;

void print(vector<vector<int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

int main(){
	int n, m, q;
	cin >> n >> m >> q;
	vector<vector<int>> trains(n,vector<int>(n,0));
	rep(i, m)
	{
		int a, b;
		cin >> a >> b;
		trains[a-1][b-1]++;
	}
	vector<vector<int>> ctrains(n, vector<int>(n + 1, 0));
	rep(i, n)
	{
		rep(j,n){
			ctrains[i][j + 1] = ctrains[i][j] + trains[i][j];
		}
	}
	rep(i, q)
	{
		int ans = 0;
		int a, b;
		cin >> a >> b;
		rep2(j, a - 1, b)
		{
			ans += ctrains[j][b] - ctrains[j][a - 1];
		}
		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 2944
import java.util.*;
import java.util.Map.Entry;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static Map<String, Integer> map;
	public static void main(String[] args) {
		read();
		solve();
	}
	
	static void read() {
		map = new HashMap<String ,Integer>();
		while(sc.hasNext()) {
			String str = sc.next();
			if(map.containsKey(str)) {
				int val = map.get(str);
				map.put(str, val+1);
			} else {
				map.put(str, 1);
			}			
		}
	}

	static void solve() {
		int max_len, max_appear;
		String max_len_str = "", max_appear_str = "";
		max_len = max_appear = 0;
		
		for(Entry<String, Integer> e : map.entrySet()) {
			String key = e.getKey();
			int value = e.getValue();
			int key_len = key.length();
			if(value > max_appear) {
				max_appear = value;
				max_appear_str = key;
			}
			if(key_len > max_len) {
				max_len = key_len;
				max_len_str = key;
			}
		}
		System.out.println(max_appear_str + " " + max_len_str);
	}
}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define pri(n) printf("%d",n)
#define lpri(n) printf("%lld",n)
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define F first
#define S second
#define vec vector<int>
#define map map<int,int>
#define gcd __gcd
const int mod=1e9+7;
const int N=1e6;
 
vector<int> prime;
int temp[N+5];
void seive()
{
    for(int i=2;i<=N;i++)
    {
        if(temp[i]==0)
        {
            prime.push_back(i);
            for(int j=2*i;j<=N;j=j+i)
            temp[j]=1;
        }
    }
}
 
int main()
{
    int t=1;
    //cin>>t;
 
    while(t--)
    {
        int n;
        cin>>n;
        
        int arr[n+1];
        for(int i=0;i<n;i++)
        cin>>arr[i];
        
        seive();
        
        set<int> s;
        int flag=0;
        
        int hcf=arr[0];
        for(int i=1;i<n;i++)
        {
            hcf=gcd(hcf,arr[i]);
         //   cout<<hcf<<" ";
        }
            
        for(int i=0;i<n;i++)
        {
            if(arr[i]==1)
            continue;
            
            if(temp[arr[i]]==0)
            {
                if(s.find(arr[i])!=s.end())
                {
                    flag=1;
                    break;
                }
                else
                s.insert(arr[i]);
                
                continue;
            }
            
            int val=sqrt(arr[i]);
            for(int j=0;j<prime.size();j++)
            {
                if(prime[j]>val)
                break;
                
                if(arr[i]%prime[j]==0)
                {
                    if(s.find(prime[j])!=s.end())
                    {
                        flag=1;
                        break;
                    }
                    else
                    s.insert(prime[j]);
                    while(arr[i]%prime[j]==0)
                    arr[i]/=prime[j];
                }
                
                if(arr[i]==0)
                break;
            }
            
            if(arr[i]>1)
            {
                if(s.find(arr[i])!=s.end())
                {
                    flag=1;
                    break;
                }
                else
                s.insert(arr[i]);
            }
        }
        
        if(flag==0)
        cout<<"pairwise coprime";
        
        else
        {
            if(hcf==1)
            cout<<"setwise coprime";
            
            else
            cout<<"not coprime";
        }
    }
    return 0;
}

Measured memory_bytes: 11752
a,b,c,x,y = list(map(int,input().split()))
dic = {a:x,b:y}
if 2*c >= a+b:print(a*x+b*y)
elif 2*c >= max(a,b):print(a*x+b*y-min(x,y)*(a+b-2*c))
elif 2*c >= min(a,b) and dic[min(a,b)]>=float(x+y)/2:print(a*x+b*y-min(x,y)*(a+b-2*c))
else:print(max(x,y)*2*c)


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

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

  for (int i = 1; i <= n; ++i) {
    int x = i;
    if (i%3 == 0) cout << " " << i;
    else while(x) {
      if (x%10 == 3) {
        cout << " " << i;
        break;
      }
      x /= 10;
    }
  }

  cout << endl;

  return 0;
}


Measured memory_bytes: 3112
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 2147483647
#define LINF 100000000000000007
#define MOD 1000000007
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long ll;
typedef pair<int,int> P;

int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
int a[1111][1111];
signed main(){
	
    int h,w;
    char m[1111][1111];
    queue<P> Q;
    
    cin>>h>>w;
    rep(i,h){
        rep(j,w){
            cin>>m[i][j];
        }
    }
    rep(i,h){
        rep(j,w){
            if(m[i][j]=='#'){
                Q.push(P(i,j));
                //a[i][j]=0;
            }
            //else a[i][j]=INF;
        }
    }
    while(Q.size()){
        P ke=Q.front();Q.pop();
        rep(i,4){
            int x=ke.first+dx[i],y=ke.second+dy[i];
            if(x>=0 && x<h && y>=0 && y<w && m[x][y]!='#'){
                m[x][y]='#';
                a[x][y]=a[ke.first][ke.second]+1;
                Q.push(P(x,y));
            }
        }
    }
    int max=0;
    rep(i,h){
        rep(j,w){
            max=std::max(max,a[i][j]);
        }
    }
    cout<<max<<endl;
    


    
}

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

        public class Program
        {
            public static void Main(string[] args)
            {
            	string input = Console.ReadLine();
            	Console.WriteLine(input == "A" ? "T":( input == "T" ? "A": (input == "C" ? "G" : (input == "G" ? "C": "NO"))));
            }
        }

Measured memory_bytes: 13140
#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++)

ll mod = 1e9+7;
#define NMAX 200010
ll fac[NMAX];
ll inv[NMAX];

ll mod_pow(ll a, ll n, ll mod){
    ll ret = 1;
    while(n > 0){
        if(n & 1) ret = (ret*(a % mod))%mod;
        a = ((a%mod)*(a%mod)) % mod;
        n = n >> 1;
    }
    return ret;
}

ll mod_inv(ll a, ll mod){
    return mod_pow(a, mod-2, mod);
}

void mae_nck(){
    fac[1] = 1;
    inv[1] = 1;
    for(ll i = 2; i < NMAX; i++){
        fac[i] = (fac[i-1] * i)%mod;
        inv[i] = (inv[i-1] * mod_inv(i, mod))%mod;
    }
}

ll mod_nck(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    if(k == 0 || k == n) return 1;
    ll ret = ((fac[n] * inv[k])%mod * inv[n-k])%mod;
    return ret;
}

int main(){
    mae_nck();
    ll N, K;
    cin >> N >> K;

    ll ans = 0;
    for(ll i = 0; i <= min(N-1, K); i++){
        ll k = N - i;
        ans += mod_nck(N, i) * mod_nck(N - 1, k - 1);
        ans %= mod; 
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3328
from collections import defaultdict
from itertools import product

H, W, K = map(int, input().split())
S = [input() for _ in range(H)]

i = 0
while i < len(S):
  if '1' in S[i]:
    i += 1
  else:
    del S[i]
H = len(S)

C = [[int(s[i]) for s in S] for i in range(W)]

total = sum(sum(c) for c in C)

if total <= K:
  answer = 0
else:
  answer = H * W
  for X in product([False, True], repeat=H-1):
    ans = sum(X)
    if ans > answer:
      continue
    M = [[0]]
    for i, x in enumerate(X):
      if x:
        M.append([])
      M[-1].append(i+1)
    D = [0] * len(M)
    for c in C:
      for k, m in enumerate(M):
        D[k] += sum(c[i] for i in m)
      if any(d > K for d in D):
        ans += 1
        if ans > answer:
          break
        D = [sum(c[i] for i in m) for m in M]
        if any(d > K for d in D):
          ans = answer + 1
          break
    answer = min(answer, ans)

print(answer)

Measured memory_bytes: 3564
import Data.List

main = do
   [n,m] <- map read . words <$> getLine
   as <- map read . words <$> getLine
   let s = sum as
   let tar = (reverse $ sort as) !! (m-1)
   if s > tar*4*m
      then putStrLn "No"
      else putStrLn "Yes"

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


int main()
{
	int a,b,c;
	cin >> a >> b >> c;
	if (c >= a && c <= b) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

const int N = 2005 * 2005;
bitset<N> d;
int n;
int sum;
int a[N];

int main() 
{
	cin >> n;
	for(int i=1; i<=n; i++)
	{
		cin >> a[i];
		sum += a[i];
	}	
	int req = (sum + 1)/2;
	d[0] = 1;
	for(int i=1; i<=n; i++)
	{
		d |= (d << a[i]);
	}
	for(int i=req; i<N; i++) 
	{
		if(d[i])
		{
			cout << i << endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 1792
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
//#include<vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint();
	int A[300][300];
	bool B[300][300] = {};
	bool owari = false;
	rep(i, N) rep(j, N) A[i][j] = getint();

	rep(i, N) {
		rep(j, i) {
			rep(k, N) {
				if (i == k || j == k) continue;
				if (A[i][j] == A[i][k] + A[j][k]) B[i][j] = true;
				else if (A[i][j] > A[i][k] + A[j][k]) owari = true;
			}
		}
		if (owari) break;
	}

	if (owari) {
		printf("-1");
		return 0;
	}
	ll kotae = 0;
	rep(i, N) rep(j, i) {
		if (!B[i][j]) kotae += A[i][j];
	}
	printf("%lld", kotae);

	Would you please return 0;
}

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

#define     fast()              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
#define     ll                  long long int
#define     test()              ll t; cin>>t; while(t--) 
#define     lp0(i,begin,end)    for(ll i=begin;i<end;i++)
#define     lp1(i,begin,end)    for(ll i=begin;i<=end;i++)
#define     rlp(i,begin,end)    for(ll i=end;i>=begin;i--)
#define     prec(n)             fixed<<setprecision(n)
#define     initial(a,i)        memset(a,i,sizeof(a))
#define     pb                  push_back
#define     PI                  3.1415926535897932384626433832795
#define     MOD                 1000000007
#define     F                   first
#define     S                   second
#define     all(a)              (a).begin(),(a).end()
#define     BPC(x)              __builtin_popcountll(x)
#define     gcd(a,b)            __gcd(a,b)

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

ll power(ll x,ll n)
{
    ll result = 1;
    while (n)
    {
        if (n & 1)
            result = result * x;
        n = n / 2;
        x = x * x;
    }
    return result;
}


// Solution Function
void solution(ll compte)
{
    // cout<<compte<<"\n";
    string s;
    cin>>s;
    if(s[2]==s[3] && s[4]==s[5])
    cout<<"Yes\n";
    else
    cout<<"No\n";
}
// Driver Function
int main()
{
    ll compte = 1;
    //test()
    //{
        solution(compte);
        compte++;
    //}
    return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, beg, end) for (int i = (beg); i < (end); i++)
const ll PSIZE = 10000000;

int main()
{
    int n, m, x;
    cin >> n >> m >> x;
    int c[n];
    int a[n][m];
    rep(i, 0, n)
    {
        cin >> c[i];
        rep(j, 0, m)
        {
            cin >> a[i][j];
        }
    }
    int minPrice = 1e9;
    rep(i, 1, 1 << n)
    {
        int d[m] = {};
        int price = 0;
        vector<int> s;
        rep(j, 0, n)
        {
            if (i & (1 << j))
            {
                price += c[j];
                rep(k, 0, m)
                {
                    d[k] += a[j][k];
                }
            }
        }
        bool flag = true;
        for (int num : d)
        {
            if (num < x)
            {
                flag = false;
                break;
            }
        }
        if (flag)
        {
            if (price < minPrice)
                minPrice = price;
        }
    }

    if (minPrice != 1e9)
    {
        cout << minPrice << endl;
    }
    else
    {
        cout << -1 << endl;
    }

    return 0;
}

Measured memory_bytes: 3640
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 998244353;

int main() {
    string s;
    int64_t n;
    cin >> n >> s;

    for (auto iter = s.begin(); iter != s.end(); ++iter) {
        char c = *iter;
        c += n;
        if (c > 'Z') c = c - 26;
        cout << c;

    }
    cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int k,a,b;
	for(cin>>k>>a>>b;a<=b;a++)
		if(a%k==0)
		{
			cout<<"OK";
			return 0;
		}
	cout<<"NG";
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#define ll long long
using namespace std;
ll n, sum, num, x;
int main () {
	scanf("%lld", &n);
	for(int i = 1; i <= n; i++) {
		scanf("%lld", &x);
		if(x % 4 == 0)
			sum ++;
		if(x % 2 == 0 && x % 4 != 0)
			num ++;
	} 
	if(num % 2 == 1)
		num --;
	n -= num;
	if(sum >= n / 2) printf("Yes\n");
	else printf("No\n");
	return 0; 
}

Measured memory_bytes: 256