akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
int main(void)
{
	int n,m,d,i,j,k,cnt;
	char x[101][101];
	scanf("%d%d%d",&n,&m,&d);
	for(i=0;i<n;i++){
		for(j=0;j<m;j++) scanf(" %c",&x[i][j]);
	}
	cnt=0;
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			if(x[i][j]=='.'){
					for(k=1;k<d;k++){
						if(x[i][j+k]!='.') break;
					}
					if(k==d) cnt++;
					for(k=1;k<d;k++){
						if(x[i+k][j]!='.') break;
					}
					if(k==d) cnt++;
			}
		}
	}
	printf("%d\n",cnt);
	return 0;
}

Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

int main(){
  string s;
  cin >> s;
  bool flag = s[0] == 'A';
  flag &= (s[1] >= 'a' && s[1] <= 'z');
  flag &= (s[s.size()-1] >= 'a' && s[s.size()-1] <= 'z');
  bool capc = false;
  for(int i=2; i<=s.size()-2;i++){
    char buf = s[i];
    flag &= (s[i] >= 'a' && s[i] <= 'z') || s[i] == 'C';
    if(s[i] == 'C' && capc) flag = false;
    if(s[i] == 'C') capc = true;
  }
  cout << (flag && capc ? "AC" : "WA") << endl;
}



Measured memory_bytes: 256
import numpy as np
N=int(input())
six=[1]
nine=[]
for i in range(1,N):
  six.append(6**i)
  nine.append(9**i)
  if 6**i>N:
    break
six=np.array(six)
nine=np.array(nine)
L=np.concatenate([six,nine])    
now=N
count=0
dp=np.ones(N+L.max()+1)*10**5
dp[1]=1
dp[0]=0
#dp[i+1]　iをちょうど引き出すのに必要な最小回数
for i in range(1,N):
  dp[i+1]=(dp[i-L+1]+1).min()

  
print(int(dp[N]))
#print(len(L))



Measured memory_bytes: 88740
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
int main(){
  fast;
  int n;
  string s;
  cin>>n>>s;
  cout<<((n>=3200)?s:"red")<<"\n";
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <stack>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 28)
template<typename T>
void remove(vector<T>& vector, unsigned int index){
vector.erase(vector.begin() + index);
}
vector<string> split(const string &s, char c);
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int go = 0;
int siti = 0;

void func(int a){
    if(a==5)go++;
    if(a == 7)siti++;
}

int main(void){
    int a,b,c;
    cin >> a >> b >> c;
    func(a);
    func(b);
    func(c);
    string s = (go == 2 && siti == 1)?"YES":"NO";
    cout << s << endl;

    return 0;
}

int StrToInt(string s){
    stringstream ss;
    ss << s;
    int val;
    ss >> val;
    return val;
}
string IntToStr(int i){
    stringstream ss;
    ss << i;
    return ss.str();
}

vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (int i = 0; i < s.size(); i++) {
        char ch = s[i];
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        }
        else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= n; i++) {
            if (i % 2 == 0) {
                continue;
            }
            int yakusuu = 0;
            for (int j = 1; j <= i; j++) {
                if (i % j == 0) {
                    yakusuu++;
                }
            }
            if (yakusuu == 8) {
                count++;
            }
        }
        System.out.println(count);
    }

}


Measured memory_bytes: 21844
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

/**
 * A First Grader
 */
public class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = br.readLine()) != null && !line.isEmpty()) {

			int n = parseInt(line);
			int[] ns = new int[n - 1];
			int ans;
			long[][] dp = new long[n - 1][21];

			StringTokenizer st = new StringTokenizer(br.readLine());
			for (int i = 0; i < n - 1; i++) {
				ns[i] = parseInt(st.nextToken());
			}
			ans = parseInt(st.nextToken());
			//
			dp[0][ns[0]] = 1;
			for (int i = 1; i < ns.length; i++) {
				for (int j = 0; j < 21; j++) {
					long c = dp[i - 1][j];
					if (c != 0) {
						int p = j + ns[i];
						int m = j - ns[i];
						if (p <= 20) dp[i][p] += c;
						if (m >= 0 && m <= 20) dp[i][m] += c;
					}
				}
			}
			System.out.println(dp[n - 2][ans]);
		} //end while
	} //end main
}

Measured memory_bytes: 23988
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	int now = a;
	int ans = 1;
	while(now<b)
	{
		ans++;
		now+=(a-1);
	}
	if(now-a+1>=b)ans--;
	printf("%d\n",ans);
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<ll(n); i++)
#define REPR(i, n) for(ll i=n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=m; i<ll(n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(x) ll(x.size()) 
using P = pair<int, int>;
const int INF = 2e9;

template <class Abel> struct BIT {
    vector<Abel> dat[2];
    Abel UNITY_SUM = 0;                     // to be set
    
    /* [1, n] */
    BIT(int n) { init(n); }
    void init(int n) { for (int iter = 0; iter < 2; ++iter) dat[iter].assign(n + 1, UNITY_SUM); }
    
    /* a, b are 1-indexed, [a, b) */
    inline void sub_add(int p, int a, Abel x) {
        for (int i = a; i < (int)dat[p].size(); i += i & -i)
            dat[p][i] = dat[p][i] + x;
    }
    inline void add(int a, int b, Abel x) {
        sub_add(0, a, x * -(a - 1)); sub_add(1, a, x); sub_add(0, b, x * (b - 1)); sub_add(1, b, x * (-1));
    }
    
    /* a is 1-indexed, [a, b) */
    inline Abel sub_sum(int p, int a) {
        Abel res = UNITY_SUM;
        for (int i = a; i > 0; i -= i & -i) res = res + dat[p][i];
        return res;
    }
    inline Abel sum(int a, int b) {
        return sub_sum(0, b - 1) + sub_sum(1, b - 1) * (b - 1) - sub_sum(0, a - 1) - sub_sum(1, a - 1) * (a - 1);
    }
    
    /* debug */
    void print() {
        for (int i = 1; i < (int)dat[0].size(); ++i) cout << sum(i, i + 1) << ",";
        cout << endl;
    }
};

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,q; cin >> n >> q;
  vector<int> c(n);
  REP(i,n) cin >> c[i];
  vector<int> left(q), right(q), ind(q);
  REP(i,q){
    cin >> left[i] >> right[i];
    left[i]--;
    ind[i] = i;
  }
  sort(ind.begin(), ind.end(), [&](int i, int j) {
    return right[i] < right[j];});
  BIT<int> bit(n+5);
  vector<int> prev(1100000, -1);
    vector<int> res(q, 0);
    int r = 0;
    for (auto i : ind) {
        for (; r < right[i]; ++r) {
            bit.add(prev[c[r]]+2, r+2, 1);
            prev[c[r]] = r;
        }
        int tmp = bit.sum(left[i]+1, left[i]+2);
        res[i] = max(res[i], tmp);
    }
    for (int i = 0; i < q; ++i) cout << res[i] << endl;
  return 0;
}


Measured memory_bytes: 21748
#include<bits/stdc++.h>
#define long long long
using namespace std;
const int N=1e6,inf=1e9;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int a,b,c;cin>>a>>b>>c;

  if(a+b+c>=22)cout<<"bust\n";
  else cout<<"win\n";
  
  return 0;
}

Measured memory_bytes: 256
//	Totally unrelated and not AT ALL stolen from hohohaha's, generic_placeholder_name's or katoriyuu's template
#include <bits/stdc++.h>

using namespace std;

#pragma GCC optimize("O3")
// #pragma GCC target("avx")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define gcd __gcd
#define rep(i,s,end) for(int i = (s); i <  (end); ++i)
#define rep0(i, end) for(int i =   0; i <= (end); ++i)
#define rep1(i, end) for(int i =   1; i <= (end); ++i)
#define lb lower_bound
#define ub upper_bound

#define vt vector
#define endl "\n"

#define fileopen(filename, in_type, out_type) if (fopen(filename in_type, "r")) {freopen(filename in_type, "r", stdin);freopen(filename out_type, "w", stdout);}
#define local_input(x) if (x && fopen("input.txt","r")) freopen("input.txt","r",stdin);
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

#define fscan(x)   scanf("%d",  &x)
#define fscandb(x) scanf("%lf", &x)
#define fscanll(x) scanf("%lld",&x)
//	Until next time, remember:
//			You are closer than you think.
//						_Dan Lok_

#define db double
#define ll long long
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define pi 3.1415926535897932	//faster than pi = acos(-1); but sometimes doesn't work?
//	srand(chrono::steady_clock::now().time_since_epoch().count());
//	freopen("input.txt","r",stdin);

#define mn 1 << 18
int n;
int id1[mn],id2[mn],dp1[mn],dp2[mn];
signed main()
{
	fastio;
	cin >> n; rep(i,0,1 << n){
		cin >> dp1[i]; id1[i] = i, dp2[i] = id2[i] = -1;
	}
	rep(i,1,1 << n){
		rep(j,0,n) if(i & (1 << j)){
			int jj = i ^ (1 << j);
			if(jj){
				if(id1[i] == id1[jj]) continue;
				else if(dp1[i] <= dp1[jj]){
					dp2[i] = dp1[i],  id2[i] = id1[i];
					dp1[i] = dp1[jj], id1[i] = id1[jj];
					if(dp2[i] <= dp2[jj] && id2[i] != id2[jj]){
						dp2[i] = dp2[jj], id2[i] = id2[jj];
					}
				}
				else if(dp2[i] <= dp1[jj] && id2[i] != id1[jj]){
					dp2[i] = dp1[jj], id2[i] = id1[jj];
				}
			}
			else{
				if(dp1[0] > dp1[i]){
					dp2[i] = dp1[i], id2[i] = id1[i];
					dp1[i] = dp1[0], id1[i] = id1[0];
				}
				else if(dp1[0] > dp2[i]){
					dp2[i] = dp1[0], id2[i] = id1[0];
				}
			}
		}
	}
	int ans = 0;
	rep(i,1,1 << n){
		cout << (ans = max(ans, dp1[i] + dp2[i])) << endl;
	}
	return 0;
}
// with the aura of Dora, AC!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Why is there a one in my row of exclamation marks?
 

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

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

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

	int N;
	cin >> N;

	int H[N+1] = {};
	rep (i,N)
		cin >> H[i];

	int ans = 0;
	int cnt = 0;

	for (int i =  1; i < N; i++) {
		if (H[i-1]-H[i] >= 0) {
			cnt++;
		} else {
			ans = max(ans, cnt);
			cnt = 0;
		}
	}

	ans = max(ans, cnt);

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
using namespace std;
    
int main(int argc, const char * argv[])
{
    int N,a[N];
    for(N=0 ; N < 3 ; N++)
    {
        cin >> a[N];
    }
    sort(a,a+3);
    cout << a[0] << " " << a[1] << " " << a[2]<<endl;
    return 0;
}

Measured memory_bytes: 1180
S = input()
T = input()
same = lambda x, y: all(True if i == j or i == '?' else False for i, j in zip(x, y))
n = len(T)
for i in range(len(S)-n, -1, -1):
    if same(S[i:i+n], T):
        S = S[:i] + T + S[i+n:]
        break
else:
    print('UNRESTORABLE')
    exit()
print(S.replace('?', 'a'))


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int main(){
    int n;
    cin >> n;
    string s,ss;
    set<string> dic;
    for(int i=0;i<n;i++){
        cin >> s >> ss;

        if(s=="insert"){
            dic.insert(ss);
        }else if(s=="find"){
            if(dic.count(ss) == 1){
                cout << "yes" << endl;
            }else{
                cout << "no" << endl;
            }

        }
    }
}


Measured memory_bytes: 32576
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define uLL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

using namespace std;

int main(void){
  string a,b,c;
  cin>>a;
  cin>>b;
  c=a+b;
  int c_int = stoi(c);
  double c_rooted = sqrt(c_int);
  //cout<<c_rooted<<endl;
  if(c_rooted - floor(c_rooted) == 0 ) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
#define for_(i, s, e) for (int i = s; i < e; i++)
#define for__(i, s, e) for (ull i = s; i < e; i++)
#define SSTR(x) static_cast<std::ostringstream&>((std::ostringstream() << std::dec << x)).str()
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;

ll mod = 1e9+7;
const ll mxn = 2e5+100;

ll s, inv[mxn+10];
ll nCr(ll n, ll r) {
	  if (r > n) return 0;
	  if (n - r < r) r = n - r;
	  n %= mod;
	  ll ans = 1;
	  for_(i, 0, r) {
			ans = (ans * (n - i)) % mod;
			ans = (ans * inv[i + 1]) % mod;
	  }
	  return ans;
}
 
ll modpow(ll a, ll b, ll mod) {
	ll res = 1;
	while (b) {
		if (b & 1) res = (res * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return res;
}
 
void pre() {
	for (int i = 1; i <= mxn; i++) {
		inv[i] = modpow(i, mod - 2, mod);
	}
}


int main() {
    #ifndef ONLINE_JUDGE
	// freopen("test.in", "r", stdin);
    #endif
    
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    pre();
    ll n, a, b; cin >> n >> a >> b;
    ll tot = modpow(2, n, mod);
    ll rem = nCr(n, a) + nCr(n, b);
    cout << (tot-rem+2*mod-1) % mod << endl;

    return 0;
}

Measured memory_bytes: 1920
#include <iostream>
#include <cmath>
using namespace std;
int main(){
	double a[8];
	while(cin >> a[0]){
		for(int i=1;i<8;i++) cin >> a[i];
		double b[4] = {a[2]-a[0],a[3]-a[1],a[6]-a[4],a[7]-a[5]};
		if(abs(b[0]*b[2]+b[1]*b[3])<0.00000000001) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

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

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
    cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args&&... args) {
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | ";
    __f(comma + 1, args...);
}
#define pi 3.141592653589
#define MOD 1000000007
#define to() int t; cin>>t; while(t--)
#define pb push_back
#define in insert
#define mp make_pair
#define ff first
#define ss second
#define si(s) s.size()
#define fori(it,v) for(it=v.begin();it!=v.end(); it++) 
#define for1(low,high,k) for(int i=low;i<high;i+=k)
#define for11(low,high,k) for(int j=low;j<high;j+=k)
#define for2(low,high,k) for(int i=low;i<=high;i+=k)
#define rev(high,low,k)  for(int i=high;i>=low ;i-=k)
#define all(x) x.begin(), x.end()
#define fil(x,i) memset(x,i,sizeof(x));
#define setbits(x) __builtin_popcount(x)
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define read freopen("input.txt","r",stdin)
#define write freopen("output.txt","w",stdout) 
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;


int main()
{
	boost;
	string s;cin>>s;
	ll sum=0;
	for(int i=0;i<s.size();i++){
		sum+=s[i]-'0';
		sum=sum%9;
	}
	if(sum==0)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	
return 0;
}


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

// int/long:		-2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536,870,912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)

#define	MOD 1000000007

int	main() {
	int N;
	cin >>N;
	vector<int> a(N, 0);
	for (int i=0; i<N; i++)
		cin >>a.at(i);
	sort(a.begin(), a.end());
	int S=0;
	int ac=1;
	for (int i=1; i<N; i++) {
		if (a.at(i)==a.at(i-1)) {
			ac++;
		} else {
			if (ac<a.at(i-1)) {
				S +=ac;
			} else {
				S += ac-a.at(i-1);
			}
			ac = 1;
		}
	}
	if (ac<a.back()) {
		S +=ac;
	} else {
		S += ac-a.back();
	}
	cout <<S <<endl;
	return 0;
}



Measured memory_bytes: 640
/*ex3_4
    takafumi_ueki*/
#include <stdio.h>
int main(void){
    int N;
    scanf("%d",&N);
    /*例えば,Nを2で割った余りが０（２で割り切れる）かつ
    ２で割った商が10未満だったら一桁の整数同士の掛け算で表せるということなので、それを3,4,5,,,,と調べる。*/
    if(((N%1 == 0)&&((N/1)<10))||((N%2 == 0)&&((N/2)<10))||((N%3 == 0)&&((N/3)<10))||((N%4 == 0)&&((N/4)<10))||((N%5 == 0)&&((N/5)<10))||((N%6 == 0)&&((N/6)<10))||((N%7 == 0)&&((N/7)<10))||((N%8 == 0)&&((N/8)<10))||((N%9 == 0)&&((N/9)<10))){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 128
import java.io.*;

class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int a = Integer.parseInt(str2[0]);
    int b = Integer.parseInt(str2[1]);

    if (a < b)
      System.out.println("a < b");
    else if (a > b)
      System.out.println("a > b");
    else
      System.out.println("a == b");
    }
}

Measured memory_bytes: 24324
s = str(input())
 
if 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12:
    ans = "AMBIGUOUS"
elif 0 < int(s[:2]) <= 12:
    ans = "MMYY"
elif 0 < int(s[2:]) <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)

Measured memory_bytes: 3060
n, k = map(int, input().split())
a = list(map(int, input().split()))

# 解説どおりのやりかた

s = [0] * (n + 1)
b = [0] * (n + 1)
for i in range(n):
    s[i + 1] = s[i] + a[i]
    b[i + 1] = b[i] + max(a[i], 0)

ans = 0

for i in range(n - k + 1):
    tmp1 = (b[i] - b[0]) + (b[n] - b[i + k])
    tmp2 = tmp1 + (s[i + k] - s[i])
    ans = max(ans, tmp1, tmp2)

print(ans)

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

int main()
{
  int ans = 0;
  string s, t;
  cin >> s;
  cin >> t;
  for(int i=0; i<s.size(); i++)
  {
    if(s[i]!=t[i])
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3824
#include <stdio.h>

int main(void)
{
	char S[100] = { 0 };
	int i, count = 0;
	scanf("%s", S);
	for (i = 0; i < sizeof(S); i++) {
		if (S[i] == 'C'&&count == 0) count++;
		if (S[i] == 'F'&&count == 1) {
			printf("Yes\n");
			return 0;
		}
		if (S[i] == 'F'&&count == 0)count = 0;
	}
	printf("No\n");

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define square(x) pow(x 2.0)
#define along long(x) (x).begin(),(x).end()
#define F first
#define S second
#define max_queue(x) priority_queue<x>
#define min_queue(x) priority_queue<x, vector<x>, greater<x>>
#define big_sort(v) sort(all(v), [](int a, int b) { return a > b; })//大きい順にソート
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
/*
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
*/

int main() {
  int q,t,f;
  bitset<1> reverse_count;//1は普通、0は反転
  string s,before_s = "",after_s = "";
  char c;
  cin >> s >> q;
  reverse_count.set();
  rep(i,q){
    cin >> t;
    if(t==1){
      reverse_count.flip();
    }else{
      cin >> f >> c;
      if(f==1){
        if(reverse_count.all()){
          before_s.push_back(c);
        }else{
          after_s.push_back(c);
        }
      }else{
        if(reverse_count.all()){
          after_s.push_back(c);
        }else{
          before_s.push_back(c);
        }
      }
    }
  }
  if(reverse_count.all()){
    reverse(before_s.begin(),before_s.end());
    cout << before_s << s << after_s;
  }else{
    reverse(s.begin(),s.end());
    reverse(after_s.begin(),after_s.end());
    cout << after_s << s << before_s;
  }
}


Measured memory_bytes: 1088
# %%
n = int(input())
aa = list(map(int,input().split()))

ans = 0
noww = 1
for i in range(n):
    if aa[i] != noww:
        ans += 1
    else:
        noww += 1
if noww == 1:
    print(-1)
else:
    print(ans)

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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using namespace std;

using ll=long long;
using pii=pair<int, int>;
using vi=vector<int>;

const ll LINF=1LL<<60;
const int INF=1<<29;
const int MOD=1e9+7;

int main(){
    int H, A; cin >> H >> A;
    cout << (H+A-1)/A << endl;
    return 0;
}

Measured memory_bytes: 3616
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
#include <set>

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define Fst first
#define Snd second
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

char S[100010] , T[100010];
int x[100010] , y[100010];
int q;

int main(){
	scanf("%s %s" , S , T);
	scanf("%d" , &q);
	for(int i = 0 ; S[i] != 0 ; ++i){
		x[i+1] = S[i] == 'A' ? 1 : 2;
		x[i+1] += x[i];
	}
	for(int i = 0 ; T[i] != 0 ; ++i){
		y[i+1] = T[i] == 'A' ? 1 : 2;
		y[i+1] += y[i];
	}
	repp(i,0,q){
		int a,b,c,d;
		scanf("%d%d%d%d" , &a , &b , &c , &d);
		//printf("%d %d %d %d " , x[b] , x[a-1] , y[d] , y[c-1]);
		printf("%s\n" , (x[b] - x[a-1] - y[d] + y[c-1]) % 3 == 0 ? "YES" : "NO");
	}
	return 0;
}


Measured memory_bytes: 1408
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
#include <list>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define F first
#define S second


int dx[]={0,1,0,-1},dy[]={1,0,-1,0};

int n,used[10],w[10],s[10];
string name[10];
double ansg;
int ansnum[10],tansnum[10];

void dfs(int weight,int up){
  if(up==n){
    int tw=0;
    rep(i,n)tw+=(n-i)*w[tansnum[i]];
    if(ansg>1.0*tw/weight){
      ansg=1.0*tw/weight;
      rep(i,n)ansnum[i]=tansnum[i];
    }
    return;
  }
  
  rep(i,n){
    if(used[i])continue;
    if(s[i]<weight)return;
  }
  
  rep(i,n){
    if(used[i])continue;
    if(s[i]<weight)return;
    used[i]=1;
    tansnum[up]=i;
    dfs(weight+w[i],up+1);
    used[i]=0;
  }
}

main(){
  while(cin>>n,n){
    ansg=100;
    rep(i,n){
      cin>>name[i]>>w[i]>>s[i];
    }

    dfs(0,0);
    rep(i,n){
      cout<<name[ansnum[n-1-i]]<<endl;
    }
  }
}

Measured memory_bytes: 908
#include <iostream>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <queue>
#define llint long long
#define inf 1e18

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

llint n;

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

  cin >> n;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      if(i >= j) continue;
      for(int k = 10; k >= 0; k--){
        if((i&(1<<k)) != (j&(1<<k))){
          cout << k+1 << " ";
          break;
        }
      }
    }
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template <class M>
struct SegmentTree{
    using T = typename M::T;
    int sz;
    vector<T> seg;
    explicit SegmentTree(int n) {
        sz = 1;
        while(sz < n) sz <<= 1;
        seg.assign(2*sz, M::e());
    }

    void set(int k, const T &x){ seg[k + sz] = x; }

    void build(){
        for (int i = sz-1; i > 0; --i) seg[i] = M::f(seg[2*i], seg[2*i+1]);
    }

    void update(int k, const T &x){
        k += sz;
        seg[k] = x;
        while (k >>= 1) seg[k] = M::f(seg[2*k], seg[2*k+1]);
    }

    T query(int a, int b){
        T l = M::e(), r = M::e();
        for(a += sz, b += sz; a < b; a >>=1, b>>=1){
            if(a & 1) l = M::f(l, seg[a++]);
            if(b & 1) r = M::f(seg[--b], r);
        }
        return M::f(l, r);
    }

    template<typename C>
    int find(int t, C &c, T &val, int k, int l, int r){
        if(r-l == 1){
            val = f(val, seg[k]);
            return c(val) ? k-sz : -1;
        }
        int m = (l+r) >> 1;
        if(m <= t) return find(t, c, val, (k << 1) | 1, m, r);
        if(t <= l && !c(val = f(val, seg[k]))) return -1;
        int lv = find(t, c, val, (k << 1) | 0 , l, m);
        if(~lv) return lv;
        return find(t, c, val, (k << 1) | 1, m, r);
    }

    template<typename C>
    int find(int t, C &c){
        T val = M::e();
        return find(t, c, val, 1, 0, sz);
    }
    T operator[](const int &k) const { return seg[k + sz]; }
};


struct Monoid{
    using T = int;
    static T f(T a, T b) { return a|b; }
    static T e() { return 0; }
};

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    SegmentTree<Monoid> seg(n);
    for (int i = 0; i < n; ++i) {
        seg.set(i, (1 << (s[i]-'a')));
    }
    seg.build();
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i) {
        int cc;
        cin >> cc;
        if(cc == 1){
            int a; char b;
            cin >> a >> b;
            seg.update(a-1, (1 << (b-'a')));
        }else {
            int l, r;
            cin >> l >> r;
            cout << __builtin_popcount(seg.query(l-1, r)) << "\n";
        }
    }
    return 0;
}

Measured memory_bytes: 4996
#include <bits/stdc++.h>
using namespace std;
struct Edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    Edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<Edge>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reprep(i,j,w,h) rep(j,h)rep(i,w)
#define rrep(i,m, n) for(int i = m; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> a(n);rep(i,n)std::cin >> a[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<int>(n,a)));
typedef long long ll;
const int INF = 2000000000;
const long INF64 = 1000000000000000ll;
const ll MOD = 1000000007LL;
typedef unsigned int uint;
int main(){
  int a,b;
  std::cin >> a>>b;
  std::cout << max({a+b,a-b,a*b}) << std::endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
typedef long long ll;
using namespace std;
 
int main(){
  int p,q,r;
  cin >> p >> q >>r;
 
  int ans = p+q;
  
  if(ans > q+r) ans = q+r;
  if(ans > r+p) ans = r+p;
  
  cout << ans << endl;
 
  return 0;
  
}

Measured memory_bytes: 256
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_5_B&lang=jp


#include<iostream>
 using namespace std;

int main(){

 int H , W ;

    while(1)
 	{

    cin >> H >> W ;

 	    if ( H == 0 && W == 0 ){ //描画の終了条件
        break ;
        }else{
        // プログラムの処理を続行する
        }


        // 描画アルゴリズム
        // Y方向の描画
        for (int i = 1; i <= H ; i = i + 1 )
        {

            //X方向の描画

            for (int j = 1; j <= W ; j = j + 1 )
            {
 

                if ( j == W ){
                cout << "#" << endl ;   //行の最後の文字なら、#を描画して改行する
                } else if ( i == 1 ) {              
                cout << "#" ;           //最初の行なら、#を描画する
                } else if ( i == H ){
                cout << "#" ;           //最後の行なら、#を描画する
                } else if ( j == 1 ){
                cout << "#" ;           //行の最初の文字なら、#を描画する
                } else{
                cout << "." ;           //そうでないなら、.を描画する
                }

            }


        }
        
     cout << endl ; //データセット間の改行
 	}

 return 0;

 }


Measured memory_bytes: 3084
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

const int INF = 1001001001;

int main() {
  int n,r;
  cin >> n >> r;
  int sum = 0;

  if (n >= 10) {
    sum = r;
  }else{
    sum = r + 100 * (10-n);
  }

  cout << sum << endl;

}


Measured memory_bytes: 888
#![allow(non_snake_case)]
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;
use num_traits::*;
use superslice::*;
use std::ops::*;

use itertools::Itertools;
use itertools_num::ItertoolsNum;

#[fastout]
fn main() {
    input!{
        _: usize,
        s: Chars, t: Chars,
    }

    let mut ans = String::new();

    for (ss, tt) in s.iter().zip(t.iter()) {
        ans.push(*ss);
        ans.push(*tt);
    } 

    println!("{}", ans);
}


Measured memory_bytes: 2108
#include <cstdio>

int main()
{
    int x,y;
    scanf("%d%d",&x,&y);
    if (x % y==0) printf("-1");
    if (y / x>=3) printf("%d",2*x);
    else
    {
        long long sum=x;
        for (int i=2;i<=1000;i++){
            sum+=x;
            if (sum % y !=0){
                printf("%d",sum);
                break;
            }
        }
    }
}


Measured memory_bytes: 128
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        
        if (a == (b + c)) {
            System.out.println("Yes");
        }
        
        else if (b == (a + c)) {
            System.out.println("Yes");
        }
        
        else if (c == (a + b)) {
            System.out.println("Yes");
        }
        
        else
           System.out.println("No");
    }     
}


Measured memory_bytes: 21844
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
const double PI = 3.141592653589793238;
const double EPS = 1e-10;
ll d[500001];
ll pos[500001];
ll NG[500001];
int main() {
	int N;
	ll D;
	cin >> N >> D;
	for (int i = 1; i <= N; i++) cin >> d[i];
	pos[0] = D;
	for (int i = 1; i <= N; i++) {
		pos[i] = min(pos[i - 1], abs(pos[i - 1] - d[i]));
	}
	NG[N] = 1;
	for (int i = N; i > 1; i--) {
		ll nxt = d[i] + NG[i];
		if (d[i] - NG[i] >= (d[i] + 1) / 2) nxt = min(nxt, d[i] - NG[i]);
		if (NG[i] < (d[i] + 1) / 2) nxt = min(nxt, NG[i]);
		NG[i - 1] = nxt;
	}
	int Q;
	cin >> Q;
	for (int i = 0; i < Q; i++) {
		int q;
		cin >> q;
		if (q == N) {
			if (pos[N - 1] > 0) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
		else {
			if (pos[q - 1] >= NG[q]) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
	}
}

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

void BubbleSort(char *suit, int *value, int N){
    for(int i = 0; i < N; i++){
        for(int j = N-1; j > i; j--){
            if(value[j] < value[j-1]){
                int temp_int = value[j];
                value[j] = value[j-1];
                value[j-1] = temp_int;
                char temp_char = suit[j];
                suit[j] = suit[j-1];
                suit[j-1] = temp_char; 
            }
        }
    }
}

void SelectionSort(char *suit, int *value, int N){
    for(int i = 0; i < N; i++){
        int minj = i;
        for(int j = i; j < N; j++){
            if(value[j] < value[minj]){
                minj = j;
            }
        }
        int temp_int = value[i];
        value[i] = value[minj];
        value[minj] = temp_int;
        char temp_char = suit[i];
        suit[i] = suit[minj];
        suit[minj] = temp_char;
    }
}

bool isStable(char *suit1, char *suit2, int N){
    for(int i = 0; i < N; i++){
        if(suit1[i] != suit2[i]){
            return false;
        }
    }
    return true;
}

void PrintCard(char *suit, int *value, int N){
    for(int i = 0; i < N; i++){
        if(i > 0){
            cout << " ";
        }
        cout << suit[i] << value[i];
    }
    cout << endl;
}

int main(void){
    int N;
    cin >> N;
    char suit1[N], suit2[N];
    int value1[N], value2[N];
   for(int i = 0; i < N; i++){
       cin >> suit1[i] >> value1[i];
    }
    for(int i = 0; i < N; i++){
        suit2[i] = suit1[i];
        value2[i] = value1[i];
    }
    BubbleSort(suit1, value1, N);
    SelectionSort(suit2, value2, N);
    PrintCard(suit1, value1, N);
    cout << "Stable" << endl;
    PrintCard(suit2, value2, N);
    if(isStable(suit1, suit2, N)){
        cout << "Stable" << endl;
    }
    else{
        cout << "Not stable" << endl;
    }
    return 0;
}


Measured memory_bytes: 3084
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	int n, h, w, a, b, ans = 0;
	scanf("%d%d%d", &n, &h, &w);
	rep(i, n) {
		scanf("%d%d", &a, &b);
		ans += (a >= h && b >= w);
	}
	printf("%d\n", ans);
	Please AC;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define mat vector<vi>
using namespace std;
const int mod = 1e9+7;
const int N = 1e4+5;
int dp[N][102];
main() {
    ios::sync_with_stdio(0);
    string k;
    int d;
    cin >> k>>d;
    dp[0][0] = 1;
    for (int i = 1; i < N; i++) {
        for (int rem = 0; rem < d; rem++)
        for (int dig = 0; dig <= 9; dig++)
            (dp[i][(rem+dig)%d] += dp[i-1][rem])%=mod;
    }
    int g = 0;
    int ans = 0;
    for (int i = 0; i < k.size(); i++) {
        int rem = (int)k.size() - (i+1);
        int e = (k[i] - '0');
        for (int q = 0; q < e; q++) {
        (ans += dp[rem][((d - g - q)%d+d)%d])%=mod;
        if (q ==0 && i == 0) ans--;
        if(ans == -1) ans+=mod;
        }
        g += (k[i] - '0');
            g%=d;
    }
    if (g % d == 0) (ans = (ans+1)%mod);
    cout << ans;

}


Measured memory_bytes: 7668
#include <bits/stdc++.h> 
using namespace std;
const long INF=1000000000000000;
const long MOD=1000000007;

int main(){
    long N,T;
    cin>>N>>T;
    vector<long> t(N);
    for(int i=0;i<N;i++)cin>>t.at(i);
    
    long ans=T;
    
    for(int i=1;i<N;i++) ans+=T-max((long)0,t.at(i-1)+T-t.at(i));
    
    cout<<ans<<endl;
    
    
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int a[10];
int main()
{
    int n=6,i=0;
    while (n--) {
        cin>>a[i];
        i++;
    }
    cout<<max(a[4],a[5])+a[0]+a[1]+a[2]+a[3]-min(a[0],min(a[1],min(a[2],a[3])))<<endl;
}



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

int n;

void solve()
{
	int k = 1;
	while(k*(k-1)/2 < n) k++;
	if(k*(k-1)/2 > n){
		cout<<"No\n";
		return;
	}
	cout<<"Yes\n";
	cout<< k <<'\n';
	vector<set<int>> ans(k);
	int cur = 1;
	for(int i=0;i<k;++i){
		for(int j=i+1;j<k;++j){
			ans[i].insert(cur);
			ans[j].insert(cur);
			cur++;
		}
	}
	for(int i=0;i<k;++i){
		cout<<ans[i].size();
		for(int y : ans[i]) cout<< ' ' << y;
		cout<<'\n';
	}
}

int main()
{
	cin >> n;
	solve();
	return 0;
}

Measured memory_bytes: 12820
// #define DEBUGGING
#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 T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return max(t, 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...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return max(low, min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { t = clamp(t, low, high); }

namespace __init {

struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

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

template <typename T>
T make_v(T init) { return init; }

template <typename T, typename... Tail>
auto make_v(T init, size_t s, Tail... tail) {
#define rec make_v(init, tail...)
    return V<decltype(rec)>(s, rec);
#undef rec
}

int main() {
    ll N, K;
    string S;
    cin >> N >> K >> S;
    K--;
    (S[K] -= 'A') += 'a';
    cout << S << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) throws Exception {
 
//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        sc.close();
        int time = 0;
        while(a > 0 && c > 0){
        	if(time % 2 == 0){
        		c = c-b;
        	}else{
        		a = a-d;
        	}
        	time++;
        }
        System.out.println(a > 0 ? "Yes": "No");
    }
}

Measured memory_bytes: 35788
#-*-coding:utf-8-*-

def main():
    #n, k = input().split()
    n, k = map(int, input().split())
    d_list = list(map(int, input().split()))

    while True:
        if all(x not in d_list for x in list(map(int, list(str(n))))):
            ans = n
            break
        n += 1
    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
import math
a, b, h, m = map(int, input().split())
kakum = m * 6
kakuh = h * 30 + m * 30 / 60
sa = abs(kakum - kakuh)
anskaku = math.radians(min(360 - sa, sa))
ans = math.sqrt(a * a + b * b - 2 * a * b * math.cos(anskaku))
print(ans)

Measured memory_bytes: 62484
#include<stdio.h>

int main(void)
{
  int n;
  scanf("%d",&n);
  int i,j;
  for(i=1;i<=9;i++)
    for(j=1;j<=9;j++)
      if(n==i*j){
        printf("Yes\n");
        return 0;
      }
  printf("No\n");
  return 0;
}

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

ll f(ll n){
  if(n == 1){
    return n; 
  }
  else{
    n += n-1;
    return f(n-1);
  }
}

int main(){
  ll n;
  cin >> n;
  cout << n*(n-1)/2 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	string a,b,c;
	cout << s.substr(0,5) << " " << s.substr(6,7) << " " << s.substr(14,5);
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx")
// #pragma comment(linker, "/stack:200000000"]
 
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <stack>
#include <random>
#include <fstream>
#include <sstream>
#include <chrono>

#define fi first
#define se second
#define pb push_back
#define ll long long
#define ld long double
#define hm unordered_map 
#define pii pair<int, int>
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define cinv(v) for (auto& x: v) cin >> x
#define fr(i, n) for (int i = 0; i < n; ++i)
#define fl(i, l, n) for (int i = l; i < n; ++i)

#define int ll

using namespace std;

#ifdef __LOCAL
	#define dbg(x) cerr << #x << " : " << x << '\n'
	const int maxn = 50 + 5;
#else 
	#define dbg(x)
	const int maxn = 50 + 5;
#endif

//tg: @galebickosikasa
 
ostream& operator << (ostream& out, vector<int>& v) {
	for (auto& x: v) out << x << ' ';
	return out;
}

ostream& operator << (ostream& out, pii& v) {
	out << v.fi << ", " << v.se;
	return out;
}

istream& operator >> (istream& in, pii& a) {
	in >> a.fi >> a.se;
	return in;
}

const ll inf = (ll) 2e9;
const ld pi = asin (1) * 2;
const ld eps = 1e-8;
const ll mod = (ll)1e9 + 7;
const ll ns = 97;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

int dp[maxn * maxn][maxn];

signed main () {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int n, a;
	cin >> n >> a;
	vector<int> goo (n);
	cinv (goo);
	dp[0][0] = 1;
	fl (i, 1, n + 1) {
		int x = goo[i - 1];
		for (int j = maxn * maxn - 1; j >= x; --j) {
			fr (k, maxn - 1) dp[j][k + 1] += dp[j - x][k];
		}
	}
	// fr (i, 50) {
	// 	dbg (i);
	// 	dbg (dp[i]);
	// }
	// for (auto& x: dp) dbg (x);
	int ans = 0;
	fl (k, 1, n + 1) {
		int s = a * k;
		ans += dp[s][k];
		dbg (ans);
	}
	cout << ans << '\n';






}

Measured memory_bytes: 4952
import Control.Monad
import qualified Data.ByteString.Char8 as BS
import Data.List
import Data.Maybe

readString = map BS.unpack . BS.words

getString = readString <$> BS.getLine

main = do
  [a, b] <- getString
  let a' = read a :: Integer
  let b' = read (delete '.' b) :: Integer
  print $ (a' * b') `div` 100


Measured memory_bytes: 3952
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a1(100000,0), a2(100000,0);
  REP(i,n/2){
    int v1,v2;
    cin >> v1 >> v2;
    a1[v1-1]++;
    a2[v2-1]++;
  }
  auto max1 = max_element(ALL(a1));
  auto max2 = max_element(ALL(a2));
  
  sort(ALL(a1), greater<int>());
  sort(ALL(a2), greater<int>());
  bool flag = (max1 - a1.begin() == max2 - a2.begin());
  cout << (flag ? n-a1[0]-max(a1[1],a2[1]) : n-a1[0]-a2[0]) << '\n';
  return 0;
}

Measured memory_bytes: 1024