akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#ifdef _DEBUG
#include "../../../debug_print.hpp"
#else
#define debug(...)
#endif
#define sort_(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; 0 <= i; i--)
#define for_(i, start, end) for (int i = start; i < end; i++)
#define rfor(i, start, end) for (int i = start - 1; 0 <= i; i--)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1'050'000'000;
constexpr long long INF64 = 4'000'000'000'000'000'000;
constexpr int MOD7        = 1'000'000'007;
constexpr int MOD53       = 998'244'353;
constexpr double PI       = 3.14159265358979323846;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}

void fprint() { std::cout << '\n'; }
template <class H, class... T> void fprint(H &&head, T &&... args) {
    std::cout << std::fixed << std::setprecision(10) << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    fprint(std::forward<T>(args)...);
}

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

    int N, K;
    scan(N, K);
    vector<ld> p(N);
    rep(i, N) {
        ld x;
        scan(x);
        p[i] = (ld)(x * (x + 1) / 2.0);
        p[i] /= x;
    }
    debug(p);
    ld ans = 0.0;
    ld pre = 0.0;
    rep(i, K) { pre += p[i]; }
    ans = pre;
    for_(i, K, N) {
        ld now = pre - p[i - K] + p[i];
        chmax(ans, now);
        pre = now;
    }
    fprint(ans);

    return 0;
}

Measured memory_bytes: 3456
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;

int main() {
  string s; cin >> s;
  bool isrepeat = false;
  string prev = "";
  for (int i=0;i<4;++i){
    auto sub = s.substr(i,1);
    if(sub == prev){
      isrepeat = true;
      break;
    }
    prev = sub;
  }
  if(isrepeat){
    cout << "Bad" << endl;
  } else {
    cout << "Good" << endl;
  }
  return 0;
}


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

int main() {
  string s;
  while (true) {
    cin >> s;
    if (s == "-") break;
    int m, h;
    cin >> m;
    for (int i = 0; i < m; ++i) {
      cin >> h;
      s = s.substr(h, s.size() - h) + s.substr(0, h);
    }
    cout << s << endl;
  }

  return 0;
}


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

typedef long long int ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ar array
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll mod = 1e9 + 7;
const ll inf = 2e9 + 5;
double PI = 3.14159265358979323846;

const int N = 1e5 + 5;
vi dp(N, inf);

void solve() {

    int n;
    cin >> n;
    int k;
    cin >> k;
    int h[n + 1];
    for (int i = 1; i <= n; i++) {
        cin >> h[i];
    }

    dp[1] = 0;

    for (int i = 2; i <= n; i++) {
        for (int j = 1; j <= k and i - j; j++) {
            dp[i] = min(dp[i], dp[i - j] + (abs(h[i] - h[i - j])));
        }
    }
    cout << dp[n] << endl;

}

int32_t main()
{
    IOS
    // int T; cin >> T; while (T--)
    solve();
    return 0;
}


Measured memory_bytes: 3968
N, K = map(int, input().split())
cnt = [0 for _ in range(10**5 + 10)]

for i in range(N):
    a, b = map(int, input().split())
    cnt[a] += b

res = 0
for i in range(len(cnt)):
    res += cnt[i]
    if res >= K:
        break
print(i)

Measured memory_bytes: 11836
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
d = {}
for i in range(len(a)):
    if a[i] - 1 in d:
        v = d[a[i] - 1]
        del d[a[i] - 1]
        d[a[i]] = v + 1
    else:
        d[a[i]] = 1
print(len(a) - max(list(d.values())))

Measured memory_bytes: 29472
#include <stdio.h>
int main(void){
    // Your code here!
	int h,m,s;
	scanf("%d", &s);
	m=s/60; s=s%60;
	h=m/60; m=m%60;
	printf("%d:%d:%d\n", h, m, s);
	return 0;
}


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


def solve(N: int, K: int, h: "List[int]"):
    persons = 0

    for _h in h:
        if _h >= K:
            persons += 1

    print(persons)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    h = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, h)


if __name__ == '__main__':
    main()


Measured memory_bytes: 12004
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;

struct edge { int to, cost; };

int Diameter(int n, const vector<vector<edge>> &g) {
        vector<int> dp(n), sz(n);
        function<void (int, int)> dfs = [&](int u, int prev) {
                vector<int> child;
                for (auto e : g[u]) {
                        int v = e.to, d = e.cost;
                        if (v == prev) continue;
                        dfs(v, u);
                        child.push_back(sz[v] + d);
                        sz[u] = max(sz[u], sz[v] + d);
                        dp[u] = max(dp[u], dp[v]);
                }
                sort(child.rbegin(), child.rend());
                if (child.size() >= 1) dp[u] = max(dp[u], child[0]);
                if (child.size() >= 2) dp[u] = max(dp[u], child[0] + child[1]);
        };
        dfs(0, -1);
        return dp[0];
}

int main() {
        int n;
        scanf("%d", &n);
        vector<vector<edge>> g(n);
        for (int i = 0; i < n - 1; i ++) {
                int a, b, c;
                scanf("%d%d%d", &a, &b, &c);
                g[a].push_back({b, c});
                g[b].push_back({a, c});
        }
        printf("%d\n", Diameter(n, g));
        return 0;
}

Measured memory_bytes: 24288
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set> 
#include<math.h>
#define pai 3.14159265358979323846264338327950288;
#define keta(n) cout << fixed << setprecision((n));
using ll = long long;
int main(){
  int a,b;
  cin>>a>>b;
  if(a%2==0||b%2==0)cout<<"Even"<<endl;
  else cout<<"Odd"<<endl;
  



}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
#define fi first
#define se second
#define pb push_back
char a[N],b[N];
int main() {
  ios::sync_with_stdio(false);
  cin>>a+1>>b+1;
  int n=strlen(a+1);
  int ans=0;
  for(int i=1;i<=n;i++){
    ans+=a[i]!=b[i];
  }
  cout<<ans<<'\n';
  return 0;
}

Measured memory_bytes: 4044
N,A,B = map(int,input().split())
S = input()

passn = 0
passab = 0

for s in S:
    if s == 'c':
        print('No')
        continue
    elif s == 'a':
        if passn < A+B:
            passn += 1
            print('Yes')
        else:
            print('No')
    else:
        if passn < A+B and passab < B:
            passn += 1
            passab += 1
            print('Yes')
        else:  
            print('No')



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

int main()
{
	int A, B;
	cin >> A >> B;
	vector<int> X(A), Y(B);
	for (int i = 0; i < A; i++) {
		cin >> X[i];
	}
	for (int i = 0; i < B; i++) {
		cin >> Y[i];
	}
	int res = 0;
	for (int s = 0; s < B; s++) {
		int cnt = 0;
		for (int i = 0, j = s; i < A && j < B; i++) {
			if (X[i] == Y[j]) {
				cnt++;
				j++;
			}
		}
		res = max(res, cnt);
	}
	cout << res << endl;
	return 0;
}



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

int main() {
    int a, b;
    cin >>a >>b;
    string ret;
    if(a>0) {ret = "Positive";}  // 0 < a <= b
    if(a==0) {ret = "Zero";}      // 0 = a <= b
    if(a<0) {
        if (b>=0) {ret = "Zero";} // a < 0 <= b
        if (b<0) {ret = ((b-a)%2==0) ? "Negative" : "Positive";}
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 256
import collections
h, w = map(int, input().split())
ch, cw = map(int, input().split())
dh, dw = map(int, input().split())
s = [input() for _ in range(h)]

ch -= 1
cw -= 1
dh -= 1
dw -= 1

d = collections.deque()
d.append((ch, cw))
visit = set()
x = ch
y = cw
cost = [[-1]*w for _ in range(h)]
cost[ch][cw] = 0

while len(d) > 0:
    x, y = d.popleft()
    if (x, y) not in visit:
        visit.add((x, y))
    else:
        continue
    for i in range(5):
        for j in range(5):
            x_n = x+i-2
            y_n = y+j-2
            if x_n >= 0 and x_n < h and y_n >= 0 and y_n < w:
                if s[x_n][y_n] == '.' and (x_n, y_n) not in visit:
                    if pow(i-2, 2)+pow(j-2, 2) == 1:
                            d.appendleft((x_n, y_n))
                            cost[x_n][y_n] = cost[x][y]
                    else:
                        d.append((x_n, y_n))
                        if cost[x_n][y_n] == -1:
                            cost[x_n][y_n] = cost[x][y]+1

print(cost[dh][dw])


Measured memory_bytes: 212156
local function reada(n,m)m=m or 1 r={}for i=1,m do r[i]={}end for i=1,n do for j=1,m do r[j][i]=io.read"*n"end end return unpack(r)end
local function b_search(t,k,min,max)
	if(min>max)then return -1 end
	local mid=min+math.floor((max-min)/2)
	if(t[mid]>k)then return b_search(t,k,min,mid-1)
	elseif(t[mid]<k)then return b_search(t,k,mid+1,max)
	else return mid
	end
end
local function b_search2(t,k,min,max)
	if(min>max)then return min end
	local mid=min+math.floor((max-min)/2)
	if(t[mid]>k)then return b_search2(t,k,min,mid-1)
	elseif(t[mid]<k)then return b_search2(t,k,mid+1,max)
	else return mid
	end
end

Q=io.read"*n"
l,r=reada(Q,2)

a={2}
for i=3,200000,2 do
	table.insert(a,i)
end

for i=3,math.sqrt(200000),2 do
	local b={}
	for _,v in ipairs(a)do
		if(v%i~=0 or v==i)then table.insert(b,v)end
	end
	a=b
end

s={0}
for i=1,50000 do
	if(b_search(a,i,1,#a)~=-1 and b_search(a,i*2-1,1,#a)~=-1)then
		s[i+1]=s[i]+1
	else
		s[i+1]=s[i]
	end
end

for i=1,Q do
	print(s[(r[i]+1)/2+1]-s[(l[i]+1)/2])
end

Measured memory_bytes: 12820
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            char[] code = s.ToCharArray();

            var Badflg = false;
            for(int i=0; i<code.Length-1; i++)
            {
                if (code[i] == code[i + 1])
                {
                    Badflg = true;
                }

                if (Badflg)
                {
                    break;   
                }
            }


            if (Badflg)
            {
                Console.WriteLine("Bad");
            }
            else
            {
                Console.WriteLine("Good");
            }
            
        }
    }
}


Measured memory_bytes: 13140
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] tmpArray = input.split(" ");
		int n = Integer.parseInt(tmpArray[0]);
		int c = Integer.parseInt(tmpArray[1]);
		
		Program[] programs = new Program[n];
		for(int i = 0; i < n; i++){
			tmpArray = br.readLine().split(" ");
			programs[i] = new Program(Integer.parseInt(tmpArray[0]), 
					Integer.parseInt(tmpArray[1]), Integer.parseInt(tmpArray[2]));
		}
		
		Arrays.sort(programs);
		
		//31以上の同時録画はありえない
		Program[] recorder = new Program[c + 1];
		for(int i = 0; i < n; i++){
			for(int j = 0; j < c; j++){
				if(recorder[j] == null){
					recorder[j] = programs[i];
					break;
				}
				
				else if(recorder[j].channel == programs[i].channel
						&& programs[i].start >= recorder[j].end){
					recorder[j] = programs[i];
					break;
				}
				else if((double)programs[i].start >= recorder[j].end + 0.5){
					recorder[j] = programs[i];
					break;
				}
			}
		}
		
		//結局いくつ使ったか
		for(int i = 0; i <= c; i++){
			if(recorder[i] == null){
				System.out.println(i);
				break;
			}
		}
	}

}

class Program implements Comparable<Program>{
	int start;
	int end;
	int channel;
	
	public Program(int s, int e, int c){
		start = s;
		end = e;
		channel = c;
	}

	public int compareTo(Program p) {
		//return this.end - p.end;
		return this.start - p.start;
	}
}

Measured memory_bytes: 47936
#include <stdio.h>
 int main()
{
    int n,a,c;
    while(scanf("%d",&n)!=EOF)
   {
        a=n/100;
        c=n%10;
        if(a==c)
            printf("Yes\n");
       else
            printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 128
S = input()
N = (len(S) - 1) // 2
if S != S[::-1]:
    print("No")
elif S[:N] != S[:N][::-1]:
    print("No")
elif S[N + 1 :] != S[N + 1 :][::-1]:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <functional>
using namespace std;

typedef long long ll;

ll t[100003], a[100003];
ll flag[100003];
ll mi[100003];

int main() {
	int N; cin >> N;
	for (int i = 1; i <= N; ++i) cin >> t[i];
	for (int i = 1; i <= N; ++i) cin >> a[i];
	for (int i = 1; i <= N; ++i) {
		flag[i] = t[i] != t[i - 1] ? t[i] : 0;
		mi[i] = t[i];
	}
	for (int i = N; i >= 1; --i) {
		if (a[i] != a[i + 1]) {
			if (flag[i] != 0 && flag[i] != a[i]) {
				cout << 0 << endl;
				return 0;
			}
			flag[i] = a[i];
		}
		mi[i] = min(mi[i], a[i]);
	}
	for (int i = 1; i <= N; ++i) {
		if (mi[i] < flag[i]) {
			cout << 0 << endl;
			return 0;
		}
	}
	ll ans = 1, mod = 1e9 + 7;
	for (int i = 1; i <= N; ++i) {
		if (flag[i] != 0) continue;
		ans *= mi[i];
		ans %= mod;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3328
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		ArrayList<Integer> hList = new ArrayList<Integer>();
		ArrayList<Integer> wList = new ArrayList<Integer>();
		int H = 0;
		int W = 0;

		while (true) {

			H = input();
			W = input();

			if (H == 0 && W == 0) {

				break;

			} else {

				hList.add(H);
				wList.add(W);

			}
		}

		for (int i = 0; i < hList.size(); i++) {

			for (int j = 1; j <= hList.get(i); j++) {

				for (int k = 1; k <=wList.get(i) ; k++) {

					System.out.print("#");

				}

				System.out.println("");

			}

			System.out.println("");

		}

		close();

	}

	public static int input() {

		return scanner.nextInt();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
}

Measured memory_bytes: 34564
#include <bits/stdc++.h>
#define int long long

using namespace std;

set<int> p;

signed main() {
	int a, b, ans = 1;
	int x, y;
	cin >> a >> b;
	x = a; y = b;
	for(int i=2; i*i <= a; i++) {
		if(x%i == 0) p.insert(i);
		while(x%i == 0) x /= i;
	}
	if(x > 1) p.insert(x);
	for(int i=2; i*i <= b; i++) {
		if(y%i == 0) ans += p.count(i);
		while(y%i == 0) y /= i;
	}
	if(y > 1) ans += p.count(y);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define reps(i, n) for (int i = 1; i <= (n); ++i)
#define repd(i, n) for (int i = (n)-1; i >= 0; --i)
#define repds(i, n) for (int i = (n); i > 0; --i)
#define loop(i, x, n) for (int i = (x); i < (n); ++i)
#define loops(i, x, n) for (int i = (x); i <= (n); ++i)
#define loopd(i, x, n) for (int i = (x); i > (n); --i)
#define loopds(i, x, n) for (int i = (x); i >= (n); --i)
#define itrep(i, a) for (auto i = begin(a); i != end(a); ++i)
#define itrepd(i, a) for (auto i = rbegin(a); i != rend(a); ++i)
#define each(i, x) for (auto &&i : x)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(a) ((int)a.size())
#define pow2(n) (n * n)
#define int ll
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
template <class T>
using p_queue = priority_queue<T, vector<T>, greater<T>>;
constexpr ll inf = static_cast<ll>(1e18);
constexpr int iinf = static_cast<int>(1e9);
constexpr double dinf = 1e10;
constexpr ld ldinf = 1e18;
constexpr double eps = 1e-8;
ll mod = static_cast<ll>(1e9 + 7);
template <class T, class... Args>
constexpr void mins(T &a, Args... args) { a = min<T>({a, args...}); }
template <class T, class... Args>
constexpr void maxs(T &a, Args... args) { a = max<T>({a, args...}); }
template <class F>
class FixPoint : private F {
public:
    explicit constexpr FixPoint(F &&f) : F(std::forward<F>(f)) {}
    template <class... Args>
    constexpr decltype(auto) operator()(Args &&... args) const { return F::operator()(*this, std::forward<Args>(args)...); }
};
template <class F>
constexpr decltype(auto) funcs(F &&f) { return FixPoint<F>{std::forward<F>(f)}; }
template <class T>
std::vector<T> vecs(int n, T &&val) { return std::vector<T>(std::forward<int>(n), std::forward<T>(val)); }
template <class... Args>
decltype(auto) vecs(int n, Args &&... args) { return std::vector<decltype(vecs(std::forward<Args>(args)...))>(std::forward<int>(n), vecs(std::forward<Args>(args)...)); }
template <class V, class T>
void fill(V &x, const T &val) { x = val; }
template <class V, class T>
void fill(vector<V> &vec, const T &val) {
    for (auto &&v : vec)
        fill(v, val);
}

void solve() {
    int n;
    cin >> n;
    vector<int> l(n);
    rep(i, n) cin >> l[i];

    int ans = 0;
    rep(i, n) loop(j, i + 1, n) loop(k, j + 1, n) {
        if (l[i] == l[j] || l[i] == l[k] || l[j] == l[k]) continue;
        int v1 = l[i], v2 = l[j], v3 = l[k];
        if (v1 < v2) swap(v1, v2);
        if (v1 < v3) swap(v1, v3);
        if (v2 + v3 > v1) ++ans;
    }

    cout << ans << endl;
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    cout.flush();
    return 0;
}

Measured memory_bytes: 3660
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string b;
    cin >> b;
    
    if(b == "A"){
        cout << "T" << endl;
    }
    else if( b == "T"){
        cout << "A" << endl;
    }
    else if (b == "C"){
        cout << "G" << endl;
    }
    else
    {
        cout << "C" << endl;
    }
}


Measured memory_bytes: 3584
N, M = map(int, input().split())

Lmax = 0
Rmin = N

for i in range(M):
    L, R = map(int, input().split())
    Lmax = max(Lmax, L)
    Rmin = min(Rmin, R)

print(max(Rmin - Lmax + 1, 0))


Measured memory_bytes: 3068
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define mp(a,b) make_pair(a,b)
#define vi vector<int>
#define mii map<int,int>
#define mpi map<pair<int,int>,int>
#define vp vector<pair<int,int> >
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define rep(i,a,n) for(i=a;i<n;i++)
#define F first
#define S second
#define endl "\n"
#define fast std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000000
#define dom 998244353
#define pi 3.14159265
#define sl(a) (int)a.length()
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define pii pair<int,int> 
#define mini 1000000000000000000
#define time_taken 1.0 * clock() / CLOCKS_PER_SEC
//mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
void shikhar7s(int cas)
{
    int n,i,b,z=0,f=0;
    cin>>n;
    vi v;
    long double d=1,a;
    fr(i,n)
    {
        cin>>a;
        b=a;
        v.pb(b);
        if(d>mod)
        {
            f=1;
        }
        else
            d*=sqrt(a);
        if(!b)
            z=1;
    }
    if(d>mod)
    {
        f=1;
    }
    if(z)
    {
        cout<<0;
        return;
    }
    if(f)
    {
        cout<<-1;
        return;
    }
    int p=1;
    fr(i,n)
    {
        p*=v[i];
    }
    cout<<p;
}
signed main()
{
    fast;
    int t=1;
    //cin>>t;
    int cas=1;
    while(cas<=t)
    {
    shikhar7s(cas);
    cas++;
    }
    return 0;
}

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

using namespace std;
typedef long long int LL;
typedef long long int LLint;
typedef pair<int,int> intpair;
typedef pair<bool,bool> boolpair;
typedef pair<string,string> strpair;
typedef pair<LL,LL> LLpair;
typedef pair<double,double> doublepair;
typedef pair<float,float> floatpair;
typedef vector<int> intvector;
typedef vector<bool> boolvector;
typedef vector<string> strvector;
typedef vector<LL> LLvector;
typedef vector<double> doublevector;
typedef vector<float> floatvector;
#define wait(sec) usleep((sec) * 1000000)
#define ED return 0;
#define TEST cout << "OK" << endl;
#define UP(a,b) ((a+(b-1))/b)
#define SORT(vec) sort(vec.begin(),vec.end());
#define DOUBLECHANGE(count) cout << setprecision(count);
#define REV(vec) reverse(vec.begin(),vec.end());
#define ipow(x,y) LL(pow(x,y))
#define INF 999999999
const long long mod = 1000000007;

int main(){
//    random_device rnd;
//    mt19937 mt(rnd());
      cin.tie(0);
      ios::sync_with_stdio(false);
      string S;
      cin >> S;
      SORT(S);
      cout << ((S[0]==S[1]&&S[2]==S[3]&&S[0]!=S[2])?"Yes":"No") << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
#include <iomanip>
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const ll MOD=1000000007;
const ll MAX_N=500010;
const ll INF=999999999999;
ll num[110][8];

int main(){
    int H,W,k;
    ll ans;
    cin>>H>>W>>k;
    num[0][0]=1;
    bool f=true;
    for(int i=1;i<8;i++) num[0][i]=0;
    for(int h=1;h<=H;h++){
        for(int w=0;w<(1<<(W-1))-1;w++){
            for(int i=0;i<W-1;i++){
                if(w>>i & 1  &&  w>>(i+1) & 1) f=false;   
            }
            if(f){
                int v[]={0,1,2,3,4,5,6,7};
                for(int i=0;i<W-1;i++){
                    if(w>>i & 1){
                        v[W-1-i]--;
                        v[W-1-i-1]++;
                    }
                }
                for(int i=0;i<8;i++){
                    num[h][i]+=num[h-1][v[i]];
                    num[h][i]%=MOD;
                }
            }
            f=true;
        }
    }
    if(W==1){
        ans=1;
    }else{
        ans=num[H][k-1];
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef  long long int ll;
typedef  long double ld;
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define pb(x) push_back(x) 
#define si(a) scanf("%lld",&a)
#define pi(a) printf("%lld",a)
#define mod 1000000007
#define f first
#define s second 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
//recursions\
#pragma comment(linker, "/stack:200000000")
//loops\
#pragma GCC optimize("unroll-loops")
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,greater_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>//s.order_of_key(val) *s.find_by_order(ind)
using namespace std;
int main()
{
	sync;
	ll n;
	cin>>n;
	int flag=1;
	pair<ll,ll> arr[n];
	for(ll i=0;i<n;i++)
	{
		ll x,y;
		cin>>x>>y;
		arr[i]={y,x};
	}
	sort(arr,arr+n);
	ll time=0;
	for(ll i=0;i<n;i++)
	{
		time+=arr[i].s;
		if(time>arr[i].f)
		flag=0;
	}
	if(flag)
	cout<<"Yes";
	else
	cout<<"No";
}

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

using namespace std;
typedef long long ll;
const int N=1e5+10;
int fa[N];
int _find(int x){return x==fa[x]?x:fa[x]=_find(fa[x]);}
int main(){
    int n,m;scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)fa[i]=i;
    for(int i=1;i<=m;i++){
        int a,b;scanf("%d %d",&a,&b);
        int u=_find(a),v=_find(b);
        if(u==v)continue;
        fa[u]=v;
    }
    int ans=0;
    for(int i=1;i<=n;i++)if(_find(i)==i)ans++;
    printf("%d\n",ans-1);
}


Measured memory_bytes: 4152
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
int main(){
    ll N;cin>>N;
    ll t,a;cin>>t>>a;
    ll h[100053];
    rep(i,N)cin>>h[i];
    rep(i,N){
        h[i]=abs(1000*a-(1000*t-h[i]*6));
    }
    ll ans=min_element(h+1,h+N+1)-h;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#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 INF 2e9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
  
int main()
{
  int N;
  cin >> N;

  vector<int> a(N);
  REP(i, N) cin >> a[i];
  
  sort(ALL(a));
  queue<int> b;
  int MAX = 1;
  REP(i,N){
    if(b.empty()){
      b.push(a.at(i));
    }else{
      if(a.at(i)-b.front()<=2){
        b.push(a.at(i));
      }else{
        MAX=max(MAX,int(b.size()));
        b.push(a.at(i));
        int c = b.front();
        while(b.front()==c){
          b.pop();
        }
      }
    }
    if(i==N-1){
      MAX = max(MAX,int(b.size()));
    }
  }

  cout << MAX << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<math.h>
using namespace std;
int main() {
	int A, B, C, D;	cin >> A >> B >> C >> D;
	int ans = 0;
	for (int i = A; i <= B; ++i) {
		if (i >= C&&i <= D) {
			++ans;
		}
	}
	if (ans < 1) {
		cout << "0" << endl;
		return 0;
	}
	cout << ans - 1 << endl;
	cin >> A;
}

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

int main (void) {
    int h, w;

    scanf("%d%d", &h, &w);

    char a[h][w+1];

    for ( int i=0; i<h; i++ )
        scanf("%s", a[i]);

    /*
    for ( int i=0; i<h; i++ ) {
        printf("%s\n", a[i]);
    }
     */

    int row, col;
    char skip_row[h], skip_col[w];

    /* initialize */
    for ( row=0; row<h; row++ )
        skip_row[row] = 1;
    for ( col=0; col<w; col++ )
        skip_col[col] = 1;

    /* 各行/列をスキップできるかチェック */
    for ( row=0; row<h; row++ ) {
        for ( col=0; col<w; col++ ) {
            if ( a[row][col] == '#' ) {
                skip_row[row] = 0;
                skip_col[col] = 0;
            }
        }
    }

    /* 出力 */
    for ( row=0; row<h; row++ ) {
        if ( skip_row[row] == 1 )
            continue;
        for ( col=0; col<w; col++ ) {
            if ( skip_col[col] == 1 )
                continue;
            printf("%c", a[row][col]);
        }
        printf("\n");
    }

    return EXIT_SUCCESS;
}


Measured memory_bytes: 128
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
//ll mod = 998244353;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<bool> ans(n, false);
    int cnt = 0;
    for (int i = n-1; i >= 0; --i) {
        bool flg = false;
        for (int j = i; j < n; j = j + (i+1)) {
            flg ^= ans[j];
        }
        if (flg ^ a[i]) {
            ++cnt;
            ans[i] = true;
        }
    }
    cout << cnt << endl;
    if (cnt == 0) return 0;
    rep(i, n) {
        if (ans[i]) {
            if (i >= 1) cout << " ";
            cout << i+1;
        } 
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 4044
from sys import stdin

N = int(stdin.readline().rstrip())
list = [int(x) for x in stdin.readline().rstrip().split()]

result = -1
flag = 1
while(flag == 1):
  for i in range(0, N):
    if(list[i]%2==0):
      list[i] = list[i] / 2
    else:
      flag = 0
  result += 1

print(result)

Measured memory_bytes: 3060
use std::io::*;
use std::cmp;
use std::str::FromStr;

fn read<T: FromStr> () -> T {
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let r: i32 = read::<i32>();
    println!("{}", 3*(r*r));
}



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

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

	int n;
	cin >> n;
	int h[n], dp[n];
	for(int i=0; i<n; ++i) {
		cin >> h[i];
	}
	dp[0]=0;
	dp[1]=abs(h[1]-h[0]);
	for(int i=2; i<n; ++i)
		dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
	cout << dp[n-1];
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;
// ------------------------------

int main() {
    ll a, b, x;
    cin >> a >> b >> x;
    ll ans = 0;
    if (a == 0) {
        a = 1;
        ans += 1;
    }
    ans += b / x - (a - 1) / x;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
// ARC091C.cpp
#include <bits/stdc++.h>

using namespace std;

int n, a, b;

int main()
{
    scanf("%d%d%d", &n, &a, &b);
    if (a + b - 1 > n || 1LL * a * b < n)
        puts("-1"), exit(0);
    while (n > 0)
    {
        int rd = min(a, n - b + 1);
        for (int i = n - rd + 1; i <= n; i++)
            printf("%d ", i);
        n -= rd, b--;
    }
    puts("");
    return 0;
}

Measured memory_bytes: 2176
#include <algorithm>
#include <cstdio>
struct data
{
	int l, r, len; 
	inline bool operator <(const data &a) const
	{
		return len < a.len; 
	}
} arr[300005]; 
int sum[100005], n, m; 
inline void modify(int pos, int x)
{
	for (; pos <= m; pos += pos & -pos)
		sum[pos] += x; 
}
inline int query(int pos)
{
	int res = 0; 
	for (; pos; pos -= pos & -pos)
		res += sum[pos]; 
	return res; 
}
int main()
{
	// freopen("ARC068-E.in", "r", stdin); 
	scanf("%d%d", &n, &m); 
	for (int i = 0; i < n; i++)
	{
		scanf("%d%d", &arr[i].l, &arr[i].r); 
		arr[i].len = arr[i].r - arr[i].l + 1; 
	}
	std::sort(arr, arr + n); 
	for (int i = 1, cur = 0; i <= m; i++)
	{
		while (cur < n && arr[cur].len <= i)
		{
			modify(arr[cur].l, 1); 
			modify(arr[cur].r + 1, -1); 
			cur++; 
		}
		int ans = 0; 
		for (int j = i; j <= m; j += i)
			ans += query(j);
		printf("%d\n", ans + n - cur);
	}
	return 0; 
}


Measured memory_bytes: 4736
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;

vector<bool> prime(int n){
  vector<bool> is_prime(n, true);
  is_prime[0] = is_prime[1] = false;
  REP(i, n){
    if(!is_prime[i]) continue;
    for(int j = 2; i*j < n; j++){
      is_prime[i*j] = false;
    }
  }
  return is_prime;
}

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

  auto p = prime(55555);
   
  vector<int> ans(N);;

  int cnt = 0;
  REP(i, 55555){
    if(cnt == N) break;
    if(p[i] && i%5 == 1) ans[cnt++] = i;
  }

  REP(i, N){
    cout << ans[i]; SPBR(i, N);
  }

  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#ifdef DEBUG
#include<conio.h>
#endif // DEBUG


int main () {
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
#endif // DEBUG

    const double PI = acos(-1);
    double a;
    scanf("%lf", &a);
    printf("%.6lf %.6lf\n", a * a * PI, 2 * a * PI);

#ifdef DEBUG
    getch();
#endif // DEBUG
    return 0;
}




Measured memory_bytes: 2120
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define ph push
#define ptc putchar
#define enter putchar('\n')
#define mod 998244353
using namespace std;
typedef pair<int,int> pii;
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef long long lnt;
inline int read(){
	int x = 0;char c = getchar();
	while (!isdigit(c)) c = getchar();
	while (isdigit(c)) x = (x << 1) + (x << 3) + c - '0' , c = getchar();
	return x;
}
inline void write(int x){
	if (!x){
       ptc('0');
       return;
	}
	int dg[20] , len = 0;
	while (x) dg[len++] = x % 10 , x /= 10;
	while (len--) ptc(dg[len]+'0');
}
inline void writeln(int x){
	write(x);
	ptc('\n');
}
inline int add(int x,int y){
	x += y;if (x >= mod) x -= mod;
	return x;
}
inline int sub(int x,int y){
	x -= y;if (x < 0) x += mod;
	return x;
}
inline int qpow(int x,int y){
	int res = 1;
	while (y){
		if (y & 1) res = 1ll * res * x % mod;
		x = 1ll * x * x % mod;y >>= 1;
	}
	return res;
}
ll a , b , c , k , res;
int main(){
	cin >> a >> b >> c >> k;
	if (k & 1) {
		res = b - a;
	}else{
		res = a - b;
	}
	if (abs(res) <= 1e18)
	cout<<res<<endl;
	else cout<<"unfair";
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF ((long long)1e18)
#define MOD ((int)1e9+7)
#define endl "\n"

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")

#define MAX 110000

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N;
	int _min = INF, sum = 0, con = 0;
	static int A[MAX];
	
	cin>>N;
	
	for(int i = 0; i < N; i++){
		cin>>A[i];
		_min = min(abs(A[i]), _min );
		sum += abs(A[i]);
		if(A[i] < 0) con++;
	}
	
	if(con%2){
		sum -= _min*2;
	}
	
	cout<<sum<<endl;
	return 0;
}

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

int n;

int main()
{
  cin >> n;
  set<int> st;
  rep(i, n)
  {
    int a;
    cin >> a;
    if(st.find(a) != st.end())
    {
      st.erase(a);
    }
    else
    {
      st.insert(a);
    }
  }
  cout << st.size() << endl;
  
  return 0;
}

Measured memory_bytes: 4864
class Card:
	def __init__(self, mark, num, order):
		self.mark = mark
		self.num = num
		self.order = order
	def __str__(self):
		return self.mark + ' ' + str(self.num)

def quick_sort(cards, p, r):
	if p < r:
		q = partition(cards, p, r)
		quick_sort(cards, p, q - 1)
		quick_sort(cards, q + 1, r)

def partition(cards, p, r):
	x = cards[r].num
	i = p - 1
	for j in range(p, r):
		if cards[j].num <= x:
			i += 1;
			swap(cards, i, j)
	swap(cards, i + 1, r)
	return i + 1

def swap(cards, i, j):
	tmp = cards[i]
	cards[i] = cards[j]
	cards[j] = tmp

def check_stability(cards):
	for i in range(1, len(cards)):
		c1 = cards[i-1]
		c2 = cards[i]
		if c1.num == c2.num and c1.order > c2.order:
			return False
	return True

n = int(input())
cards = []
for i in range(n):
	mark, num = map(str, input().split())
	cards.append(Card(mark, int(num), i))

quick_sort(cards, 0, n - 1)
stable = check_stability(cards)
if stable == True:
	print('Stable')
else:
	print('Not stable')
for i in range(n):
	print(cards[i])



Measured memory_bytes: 29652
#include <iostream>

using namespace std;

int main() {
	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;

	if((x - r) >= 0 && (x + r) <= W && (y - r) >= 0 && (y + r) <= H)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}



Measured memory_bytes: 3104
while True:
    try:
        a=list(map(str,input().split()))
        b=list(map(str,input().split()))
    except EOFError:
        break
    c,d=0,0
    for i in range(4):
        if a[i]==b[i]:
            c+=1
        elif a[i] in b:
            d+=1
    print(c,d)


Measured memory_bytes: 5556
import sys
sys.setrecursionlimit(1000000) # 再帰上限を増やす
mod = 1000000007

def main():
    input = sys.stdin.readline  # 文字列に対してinputした場合は、rstripするのを忘れずに！
    H, W = map(int, input().rstrip().split())
    maps = []
    for _ in range(H):
        line = input().rstrip()
        maps.append(line)

    # dp[i][j] = (i, j)までの経路数
    dp = [[0] * W for _ in range(H)]
    dp[0][0] = 1

    for i in range(H):
        for j in range(W):
            if (i == 0 and j == 0) or maps[i][j] == "#":
                continue
            tmp = 0
            if i - 1 >= 0 and maps[i-1][j] == ".":
                tmp += dp[i-1][j]
                tmp %= mod
            if j - 1 >= 0 and maps[i][j-1] == ".":
                tmp += dp[i][j-1]
                tmp %= mod
            dp[i][j] = tmp
    print(dp[H-1][W-1])

if __name__ == '__main__':
    main()

Measured memory_bytes: 52848
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>

using namespace std;

class UnionFind{
private:
    vector<int> Parent;
public:
    UnionFind(int N){
        vector<int> Parent(N,-1);
    }

    int root(int A){
        if(Parent[A]<0) return A;
        return Parent[A]=root(Parent[A]);
    }

    int size(int A){
        return -Parent[root(A)];
    }

    bool connect(int A,int B){
        A=root(A);
        B=root(B);
        if(A==B) return false;
        if(size(A)<size(B)) swap(A,B);
        Parent[A]-=Parent[B];
        Parent[B]=A;
    }
};

typedef long long ll;
const int division = 1000000007;
vector<ll> fac; //n!(mod M)
vector<ll> ifac; //k!^{M-2} (mod M)


ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % division;
        x = x*x % division;
        n = n >> 1;
    }
    return ans;
}

ll cmb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    fac.push_back(1);
    ifac.push_back(1);
    for(ll i = 0; i<a; i++){
        fac.push_back(fac[i]*(i+1) % division); // n!(mod M)
        ifac.push_back(ifac[i]*mpow(i+1, division-2) % division); // k!^{M-2} (mod M) ←累乗にmpowを採用
    }
    ll tmp = ifac[a-b]* ifac[b] % division;
    return tmp * fac[a] % division;
}
typedef pair<int, int> P;

int main(){
    ll N,M,K;
    cin >> N >> M >> K;
    ll ans=0;
    for(int i=1;i<M;i++){
        ans += i*(M-i)*(N*N);
    }
    for(int i=1;i<N;i++){
        ans += i*(N-i)*(M*M);
    }
    ans%=division;
    ans *= cmb(N*M-2,K-2)%division;
    cout << ans%division << endl;
}


Measured memory_bytes: 3564
//import java.lang.Math;
import java.util.*;
//import java.util.ListIterator;
//import java.util.Iterator;
//import java.util.LinkedList;

public class Main{

	public static void main(String[] arg) {

		HashSet<Integer> ht = new HashSet<Integer>();
		Scanner sc = new Scanner(System.in);
		int cnt = sc.nextInt();

		for (int i = 0; i < cnt; i++) {

			int cmt = sc.nextInt();

			switch (cmt) {

			case 0:
				int num = sc.nextInt();
				if(!ht.contains(num)) ht.add(num);
				
				
				System.out.println(ht.size());
				
				break;
			case 1:
				int num2 = sc.nextInt();
				int cnt2 = 0;
				if(ht.contains(num2)) cnt2=1;
				
				System.out.println(cnt2);
                                break;
			
			case 2:
				int num3=sc.nextInt();
				ht.remove(num3);
				break;
			
				}
				}
			
		}
	}



Measured memory_bytes: 163092
class UnionFind:
    def __init__(self, n):
        self.size   = n
        self.rank   = [0] * n
        self.weight = [1] * n
        self.parent = [i for i in range(n)]
        
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
            
    def same(self, x, y):
        return self.find(x) == self.find(y)
        
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
            self.weight[y] += self.weight[x]
        else:
            self.parent[y] = x
            self.weight[x] += self.weight[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] = self.rank[x] + 1
            
if __name__ == "__main__":
    n, q = map(int, raw_input().split())

    uf = UnionFind(n)
    
    for i in range(q):
        com, x, y = map(int, raw_input().split())
        if com == 0:
            uf.unite(x, y)
        else:
            print(1 if uf.same(x, y) else 0)
                
                
        
    
    

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

#define REP(i,n) for(int i=0;i<(n);++i)
#define FORR(it,cont) for(auto it=rbegin(cont);it!=rend(cont);++it)
#define FOR(it,cont) for(auto it=begin(cont);it!=end(cont);++it)
#define ALL(cont) begin(cont), end(cont)
#define LB(b,e,v) lower_bound(b,e,v)
#define UB(b,e,v) upper_bound(b,e,v)
#define AS_MOD(a,b) ((((a) % (b) ) + (b)) % (b))
#define MODDING(a,b) (a) = AS_MOD(a,b)
#define MAXIMIZE(a, b) (a) = max((a),(b))
#define MINIMIZE(a, b) (a) = min((a),(b))

using namespace std;
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<int, Pii> iPii;
ll gcd(ll a, ll b) {
  return b == 0 ? a : gcd(b, a % b);
}
int main(int argc, char **argv, char **envp) {
  int T;
  cin >> T;
  REP(i, T) {
    ll A,B,C,D;
    cin >> A >> B >> C >> D;
    if (A<B) {
      cout << "No" << endl;
    } else if (D<B) {
      cout << "No" << endl;
    } else if (B-1 <= C) {
      cout << "Yes" << endl;
    } else if (D%B==0) {
      if (A%B<=C) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      ll b=D%B;
      ll r=gcd(B,b);
      if (B-C>r) {
        cout << "No" << endl;
      } else {
        if((C%r)>=(A%r)) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      }
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector <string> vs;

struct pos{
	int x;
	int y;
};

vs wx,wy;

int readdata(){
	string tmp;
	bool f=true;
	while (true){
		getline(cin,tmp);
		if (cin.eof()) break;
		if (f) wx.push_back(tmp);
		else wy.push_back(tmp);
		f = !f;
	}
	return 0;
}

bool ispath(pos p, int d){
	string c="";
	switch (d){
		case 0:
			if (p.y>0) c=wy[p.y-1][p.x];
			break;
		case 1:
			if (p.x<(int)wy.size()) c=wx[p.y][p.x];
			break;
		case 2:
			if (p.y<(int)wx[0].size()) c=wy[p.y][p.x];
			break;
		case 3:
			if (p.x>0) c=wx[p.y][p.x-1];
	};
	return c=="1";
}

int nextpath(pos p, int d0){
	const int N=4, dd[N]={3,0,1,2};
	int d = -1;
	for (int i=0; i<N; i++){
		d = (d0+dd[i])%4;
		if (ispath(p, d)) return d;
	}
	return d;
}

string f0037(){
	pos p;
	p.x=0; p.y=0;
	int dp=1, dx[4]={0,1,0,-1}, dy[4]={-1,0,1,0};
	string msg="", news="URDL";
	while (true){
		dp = nextpath(p, dp);
		p.x += dx[dp];
		p.y += dy[dp];
		msg += news[dp];
		if (p.x==0 && p.y==0) break;
	}
	return msg;
}

int main(void){
	readdata();
	cout<<f0037()<<endl;	
}

Measured memory_bytes: 1184
#include <iostream>
#include <utility>
#include <vector>

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

int highestWorth(vector<Pii> item, int weight)
{
    int item_len = item.size();

    int dp[item_len][weight + 1];

    for (int i = 0; i < item_len; i++)
    {
        for (int j = 0; j <= weight; j++)
        {
            if (i == 0 || j == 0)
            {
                dp[i][j] = 0;
                continue;
            }

            // アイテムの重さが j 以内であるなら
            if (item[i].second <= j)
            {
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - item[i].second] + item[i].first);
            }
            else
            {
                dp[i][j] = dp[i - 1][j];
            }
        }
    }

    return dp[item_len - 1][weight];
}

int main()
{
    int N, W;
    vector<Pii> item;
    cin >> N >> W;

    item.push_back(make_pair(0, 0));

    for (int i = 0; i < N; i++)
    {
        int v_i, w_i;
        cin >> v_i >> w_i;

        item.push_back(make_pair(v_i, w_i));
    }

    cout << highestWorth(item, W) << endl;
}


Measured memory_bytes: 7072
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int LL;
typedef long double dd;
//#define i_7 (ll)(1E9+7)
#define i_7 998244353
#define i_5 i_7-2

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
//template<class T>void max(T a,T b){if(a<b)return b;else return a;}
//template<class T>void min(T a,T b){if(a>b)return b;else return a;}
//template<class T>bool Max(T&a, T b){if(a < b){a = b;return 1;}return 0;}
//template<class T>bool Min(T&a, T b){if(a > b){a = b;return 1;}return 0;}

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

int main(){fastio
    dd n;cin>>n;
    cout<<setprecision(20)<<n*2*3.14159265<<endl;
    
    
    return 0;
}


Measured memory_bytes: 3812