akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i,n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a,const T &b) {if(a<b){a=b; return 1;} return 0;}
template<class T>bool chmin(T &a,const T &b) {if(b<a){a=b; return 1;} return 0;}
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int a,b;
const int mx = 100;
const int h=mx,w=mx;
char g[h][w];

int main() {
  IOS;
  cin >> a >> b;
  a--; b--;

  REP(i,h) {
    char c = i<h/2 ? '#' : '.';
    REP(j,w) g[i][j] = c;
  }

  int swaped = 0;
  for (int i = 0; i < h; i+=2) {
    if (h/2 < i) {
      if (swaped == 0) {
        swap(a,b);
        swaped = 1;
      }
    }
    for (int j = 0; j < w; j+=2) {
      if (a>0) {
        g[i][j] = g[i][j] == '.' ? '#' : '.';
        a--;
      }
    }
  }

  cout << h << " " << w << endl;
  REP(i,h) REP(j,w) {
    cout << g[i][j];
    j == w-1 && cout << endl;
  }
  return 0;
}

Measured memory_bytes: 3672
n = int(input())
h = list(map(int, input().split()))

ans = 0
temp = 0
start_flg = True
for i in range(n-1):
    if start_flg:
        temp = 0

    if h[i] >= h[i+1]:
        temp += 1
        start_flg = False
    else:
        ans = max(ans, temp)
        start_flg = True
ans = max(ans, temp)

print(ans)


Measured memory_bytes: 14224
// Problem : D - Banned K
// Contest : AtCoder - AtCoder Beginner Contest 159
// URL : https://atcoder.jp/contests/abc159/tasks/abc159_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 1e10
#define PI acos(-1.0)
#define int long long
#define N 200005

int tot,n,v[N];
int a[N];

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin>>n;
    for(int i=0;i<n;i++) cin>>v[i], a[v[i]]++;
    for(int i=1;i<=n;i++) tot += a[i]*(a[i]-1)/2;
    for(int i=0;i<n;i++){
        int tmp = tot;
        if(a[v[i]]) tmp -= a[v[i]]-1;
        cout<<tmp<<endl;
    }
    return 0;
}


Measured memory_bytes: 4736
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn c_or_d(x: u64, c: u64, d: u64) -> u64 {
    let cd = lcm(c,d);
    (x / c) + (x / d) - (x / cd)
}

fn gcd(x: u64, y: u64) -> u64 {
    if x == 0 { y } else { gcd(y % x, x) }
}

fn lcm(x: u64, y: u64) -> u64 {
    x * y / gcd(x, y)
}

fn main() {
    let v = read_vec::<u64>();
    let a = v[0];
    let b = v[1];
    let c = v[2];
    let d = v[3];

    let total = b - a + 1;
    let b_cord = c_or_d(b, c, d);
    let a_cord = c_or_d(a - 1, c, d);
    let ans = total - (b_cord - a_cord);
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
using namespace std;
int main(){
	int N;	
	while(cin >> N, N){
		int m[21][21] = {0};
		for(int i = 0; i < N; ++i){
			int x, y; 
			cin >> x >> y;
			++m[x][y];	
		}
		int px = 10, py = 10;
		int M;
		cin >> M;
		int ans = m[px][py];
		for(int i = 0; i < M; ++i){
			char d; int l;
			cin >> d >> l;
			int dx = d == 'E' ? 1 : d == 'W' ? -1 : 0;
			int dy = d == 'N' ? 1 : d == 'S' ? -1 : 0;
			for(int j = 0; j < l; ++j){
				px += dx, py += dy;
				ans += m[px][py];
				m[px][py] = 0;	
			}
		}
		if (ans == N) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

Measured memory_bytes: 2996
#include<stdio.h>
#include<algorithm>

int a[15];
int x[15][15];
int y[15][15];

int b_count(int bit){
    if(bit==0) return 0;
    return b_count(bit>>1) + (bit & 1);
}

int main(){
    
    int n;
    
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        for(int j=0;j<a[i];j++){
            scanf("%d%d",&x[i][j],&y[i][j]);
            x[i][j]--;
        }
    }
    
    int ans=0;
    for(int i=0;i<(1<<n);i++){
        bool flag=true;
        for(int j=0;j<n;j++){
            if(!((i>>j)&1)) continue;
            for(int l=0;l<a[j];l++){
                if(((i>>x[j][l])&1)^y[j][l]) flag=false;
            }
        }
        if(flag) ans=std::max(ans,b_count(i));
    }
    
    printf("%d\n",ans);
    
    return 0;
    
}

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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
ostream &operator<<(ostream &os, vector<T> &v)
{
    os << "{";
    rep(i, v.size()) os << v[i] << (i == (int)v.size() - 1 ? "" : ", ");
    os << "}";
    return os;
}
template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }
struct in
{
    const size_t n = 0;
    in() = default;
    in(size_t n) : n(n){};
    template <typename T>
    operator T()
    {
        T ret;
        cin >> ret;
        return ret;
    }
    template <typename T>
    operator vector<T>()
    {
        assert(n != 0);
        vector<T> ret(n);
        for (auto &x : ret)
            cin >> x;
        return ret;
    }
};

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    int n = in();
    vint p = in(n);
    rep(i, n)-- p[i];
    int cnt = 0;

    rep(i, n)
    {
        if (p[i] == i)
        {
            ++cnt;
            ++i;
        }
    }
    cout << cnt << endl;
}

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


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

using namespace std;

#define MAX_V 514
#define INF (1<<29)

struct Edge {
    int to, cap, cost, rev;
    Edge(int to, int cap, int cost, int rev) :
        to(to), cap(cap), cost(cost), rev(rev) {}
};

int V;
vector<Edge> G[MAX_V];
int dist[MAX_V], prevv[MAX_V], preve[MAX_V];

void add_edge(int from, int to, int cap, int cost)
{
    G[from].push_back(Edge(to, cap, cost, G[to].size()));
    G[to].push_back(Edge(from, 0, -cost, G[from].size()-1));
}

int min_cost_flow(int s, int t, int f)
{
    int res = 0;
    while (f > 0) {
	fill(dist, dist + V, INF);
	dist[s] = 0;
	bool update = true;
	while (update) {
	    update = false;
	    for (int v = 0; v < V; v++) {
		if (dist[v] == INF) continue;
		for (int i = 0; i < (int)G[v].size(); i++) {
		    Edge &e = G[v][i];
		    if (e.cap > 0 && dist[e.to] > dist[v] + e.cost) {
                        dist[e.to] = dist[v] + e.cost;
			prevv[e.to] = v;
			preve[e.to] = i;
			update = true;
		    }
		}
	    }
	}
	if (dist[t] == INF) return -1;
	int d = f;
	for (int v = t; v != s; v = prevv[v]) {
            d = min(d, G[prevv[v]][preve[v]].cap);
	}
        f -= d;
	res += d * dist[t];
	for (int v = t; v != s; v = prevv[v]) {
	    Edge &e = G[prevv[v]][preve[v]];            
	    e.cap -= d;
	    G[v][e.rev].cap += d;
        }
    }
    return res;
}

int main()
{
    int N;
    cin >> N;
    vector<vector<int>> W(N, vector<int>(N)), E(N, vector<int>(N));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cin >> W[i][j];
        }
    }

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cin >> E[i][j];
        }
    }
    
    int sum = 0;
    vector<vector<char>> F(N, vector<char>(N));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cin >> F[i][j];
            if (F[i][j] == 'o') {
                sum += E[i][j];
            }
        }
    }

    int S = 2 * N, T = S + 1;
    V = T + 1;
    for (int i = 0; i < N; i++) {
        add_edge(S, i, 1, 0);
        add_edge(N+i, T, 1, 0);
    }

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if (F[i][j] == 'o') {
                add_edge(i, j + N, 1, -E[i][j]);
            } else {
                add_edge(i, j + N, 1, W[i][j]);
            }
        }
    }
    
    cout << min_cost_flow(S, T, N) + sum << endl;
    vector<int> r, c, op;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < (int)G[i].size(); j++) {
            int k = G[i][j].to - N;
            if (G[i][j].cap == 0 && F[i][k] == '.' && G[i][j].to < S) {
                r.push_back(i+1); c.push_back(k+1); op.push_back(0);
            }
            if (G[i][j].cap > 0 && F[i][k] == 'o' && G[i][j].to < S) {
                r.push_back(i+1); c.push_back(k+1); op.push_back(1);
            }
        }
    }

    cout << r.size() << endl;
    for (int i = 0; i < (int)r.size(); i++) {
        cout << r[i] << " " << c[i] << " ";
        cout << (op[i] == 0 ? "write" : "erase") << endl;
    }    
    return 0;
}

Measured memory_bytes: 3548
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main
{
    public static void process(int test_number)throws IOException
    {
        int n = ni(), arr[] = new int[n];
        for(int i = 0; i < n; i++) 
            arr[i] = ni();

        long dp[] = new long[n];
        dp[0] = 1000;

        for(int i = 1; i < n; i++){
            dp[i] = dp[i-1];
            for(int j = 0; j < i; j++){
                dp[i] = Math.max(dp[i], (dp[j] / arr[j]) * arr[i]  + (dp[j] % arr[j]));
            }
        }        

        pn(dp[n-1]);
    }
 
    static final long mod = (long)1e9+7l;
    
    static FastReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc = new FastReader();
 
        long s = System.currentTimeMillis();
        int t = 1;
        //t = ni();
        for(int i = 1; i <= t; i++)
            process(i);
 
        out.flush();
        System.err.println(System.currentTimeMillis()-s+"ms");
    }

    static void trace(Object... o){ System.err.println(Arrays.deepToString(o)); };
    static void pn(Object o){ out.println(o); }
    static void p(Object o){ out.print(o); }
    static int ni()throws IOException{ return Integer.parseInt(sc.next()); }
    static long nl()throws IOException{ return Long.parseLong(sc.next()); }
    static double nd()throws IOException{ return Double.parseDouble(sc.next()); }
    static String nln()throws IOException{ return sc.nextLine(); }
    static long gcd(long a, long b)throws IOException{ return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{ return (b==0)?a:gcd(b,a%b); }
    static int bit(long n)throws IOException{ return (n==0)?0:(1+bit(n&(n-1))); }
    
    static class FastReader{ 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader(){ 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next(){ 
            while (st == null || !st.hasMoreElements()){ 
                try{ st = new StringTokenizer(br.readLine()); } catch (IOException  e){ e.printStackTrace(); } 
            } 
            return st.nextToken(); 
        } 
  
        String nextLine(){ 
            String str = ""; 
            try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } 
            return str; 
        } 
    } 
}


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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        int x, y;
        cin >> x >> y;
        ans += (y-x + 1);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>

using namespace std;


/*--- Macro ---*/
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep1(i, n) for(int i=1; i<(int)n; i++)
#define mp make_pair
#define pb push_back


/*---  Type ---*/
typedef long long ll;


/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;


// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

// -------------------------------------------------------------------------------------

// aの方がでかい時は1を返す。
// 同じ時は0を返す。
// bの方がでかい時は-1を返す。
int compare(string a, string b) {
  if(a.length() != b.length()) {
    return (a.length() > b.length() ? 1 : -1);
  }

  rep(i, a.length()) {
    if(a[i] > b[i]) return 1;
    if(a[i] < b[i]) return -1;
  }

  return 0;
}

int main() {
  string a, b;
  cin >> a >> b;

  int res = compare(a, b);

  if(res == 0) cout << "EQUAL" << endl;
  else if(res > 0) cout << "GREATER" << endl;
  else cout << "LESS" << endl;

  return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String[] args) { 
		Scanner sc = new Scanner(System.in);
		int c,d;
		while(sc.hasNext()){
			int a=sc.nextInt();
			int b=sc.nextInt();
			c=s(a,b);
			d=a/c*b;
			System.out.println(c+" "+d);
		}
	}
	static int s(int a,int b){
		return b==0?a:s(b, a%b);
	}
}

Measured memory_bytes: 15372
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,M,X;
  cin >> N >> M >> X;
  int L=0,R=0;
  for(int i=0; i<M; i++){
    int a;
    cin >> a;
    if(a>X)R++;
    else L++;
  }
  cout << min(L,R) << endl;
}

Measured memory_bytes: 256
def main():
  import sys
  input = sys.stdin.readline
  n,W=map(int,input().split())
  w,v=[0]*n,[0]*n
  for i in range(n):
    w[i],v[i]=map(int,input().split())
  v_sum=sum(v)
  dp=[[float('inf')]*(v_sum+1) for _ in range(n+1)]
  dp[0][0]=0
  for i in range(n):
    for j in range(v_sum+1):
      dp[i+1][j]=dp[i][j - v[i]] + w[i] if j - v[i]>=0 else dp[i+1][j]
      dp[i+1][j]=min(dp[i+1][j],dp[i][j])
  ans=0
  for j in range(v_sum+1):
    if dp[n][j] <= W:
      ans = j
  print(ans)
if __name__=='__main__':
  main()

Measured memory_bytes: 309764
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
#define forn(i,n) for(int i=0; i < int(n); ++i)
#define all(x) (x).begin(), (x).end()
#define eb emplace_back
#define pb push_back
#define fst first
#define snd second

int main() {
    ios::sync_with_stdio(false);
    string a, b;
    cin >> a >> b;
    forn(i, b.size()) {
        b = b.substr(1) + b[0];
        if (a == b)
            return cout << "Yes\n", 0;
    }
    cout << "No\n";
}


Measured memory_bytes: 256
#pragma GCC optimize ("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P; typedef pair<Int,Int> Pl;
const int mod = 1e9+7;
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) v.begin(),v.end()
#define Pr(type) priority_queue<type>
#define gPr(type) priority_queue<type,vector<type>,greater<type>>
#define V(type) vector<type>
#define rep(i,n) for(int i=0; i<n; i++)
#define rer(i,st,en) for(int i=st; i<en; i++)
#define gnr(i,l,r) for(int i=int(r)-1; i>=int(l); i--)
#define eb emplace_back
#define pri1(a) cout<<a<<'\n'
#define pri2(a,n) rep(i,n-1)cout<<a[i]<<' '; cout<<a[n-1]<<'\n'
#define prip(p) cout<<p.first<<' '<<p.second<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n,m,_,x,y,q;
string s,sb;
bool ok;
char ch;

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

  cin>>n>>x>>y; V(int)a(n); rep(i,n)cin>>a[i];
  if(n==1)pri1(abs(a[0]-y));
  else pri1(max(abs(a[n-1]-y),abs(a[n-2]-a[n-1])));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define repr(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
typedef long long ll;
using VI = vector<int>;
using VB = vector<bool>;
using VS = vector<string>;
using graph = vector<vector<int>>;

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

VI a(n+1);
a.at(0)=100000000;
for (int i = 1; i <= n; i++)
{
   cin>> a.at(i);

}
for (int i = 1; i <= n; i++)
{
  if (i%2!=0&&a.at(i)%2!=0)
  {
      ans++;
  }
    
}
cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3600
#include<iostream>

using namespace std;
typedef long long ll;

ll A,B,C;

int main()
{
	cin >> A >> B >> C;

	if ((A|B|C)%2 == 1) {
		cout << 0 << "\n";
		return 0;
	}
	
	ll X = (A|B|C)^(A&B&C);	
	for (int i=1; i<32; i++) {
		if ((X&(1<<i)) > 0) {
			cout << i << "\n";
			return 0;
		}
	}

	cout << "-1\n";
	return 0;
}

Measured memory_bytes: 256
object Main {
  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)

    val n = scanner.nextInt
    val A = Array.fill(n)(scanner.nextInt)

    val r = shellSort(A, n)
    val G = r._1
    val cnt = r._2
    println(G.length)
    println(G.mkString(" "))
    println(cnt)
    A.foreach(println)
  }

  def insertionSort(A: Array[Int], n: Int, g: Int): Int = {
    var c = 0
    for(i <- g until n) {
      val v = A(i)
      var j = i - g
      while(j >= 0 && A(j) > v) {
        A(j + g) = A(j)
        j = j - g
        c = c + 1
      }
      A(j + g) = v
    }
    c
  }

  def shellSort(A: Array[Int], n: Int): (Seq[Int], Int) = {
    def f(hi: Int, n: Int): List[Int] = {
      val m = hi * 3 + 1
      if(m > n) List(hi) else hi :: f(m, n)
    }

    val G = f(1, n).reverse
    (G, G.map(insertionSort(A, n, _)).sum)
  }
}



Measured memory_bytes: 459236
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N, A, B = MAP()
S = input()

passed = 0
b_cnt = 1
for s in S:
    if s == "a":
        if passed < A + B:
            passed += 1
            print("Yes")
        else:
            print("No")
    elif s == "b":
        if passed < A + B and b_cnt <= B:
            print("Yes")
            passed += 1
        else:
            print("No")
        b_cnt += 1
    else:
        print("No")

Measured memory_bytes: 4016
use std::str::FromStr;
use std::io;

fn whitespace_three() -> (usize, usize, usize) {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).ok();
    let mut it = buf.split_whitespace().map(|n| usize::from_str(n).unwrap());
    (
        it.next().unwrap(), 
        it.next().unwrap(), 
        it.next().unwrap(),
    )
}

fn main() {
    let (r, d, x) = whitespace_three();
    let mut next = (r * x) - d;
    for i in 2000..2010 {
        println!("{}", next);
        next = (r * next) - d;    
    }
}

Measured memory_bytes: 4352
#pragma GCC optimize("O4")
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
//#define MOD (ll)(998244353)
#define MOD (ll)(1e9+7)
#define INF (1e17)
#define int ll
#define EPS (1e-6)
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }
int fpow(int b,int p){
	if(p==0) return 1;
	int h=fpow(b,p/2);
	if(p%2) return h*b%MOD*h%MOD;
	return h*h%MOD;
}

int32_t main() {
#ifdef LOCAL_TEST
	freopen("E:\\Jimmy\\2 Coding\\1 C++\\input.in","r",stdin);
	freopen("E:\\Jimmy\\2 Coding\\1 C++\\output.out","w",stdout);
	freopen("E:\\Jimmy\\2 Coding\\1 C++\\error.out","w",stderr);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);

	//code...
	int n,m; cin>>n>>m;
	cout<<fpow(2,m)*(100*(n-m)+1900*m)<<"\n";
	return 0;
}

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

public class Main {

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

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

		double r = Double.parseDouble(br.readLine());

		System.out.printf("%05f %05f", Math.PI * r * r, 2 * Math.PI * r);
	}
}

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

using str = string;
using ss = stringstream;

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

    str a,b;
    cin>>a>>b;

    if(a.size()>b.size()) puts("GREATER");
    else if(a.size()<b.size()) puts("LESS");
    else 
    {
        for(int i=0;i<a.size();i++)
        {
            if(a[i]>b[i])
            {
                puts("GREATER");
                return 0;
            }
            else if(a[i]<b[i])
            {
                puts("LESS");
                return 0;
            }
        }
        puts("EQUAL");
    }

    return 0;
}


Measured memory_bytes: 3640
/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;

class Main {
	public static void main (String[] args) {
	    Scanner sc = new Scanner(System.in);
	    int k = sc.nextInt();
	    int n = sc.nextInt();
	    int arr[]=new int[n];
	    for(int i=0;i<n;i++) arr[i]=sc.nextInt();
	    long res= k+arr[0]-arr[n-1];
	    for(int i=1;i<n;i++) res=Math.max(res,arr[i]-arr[i-1]);
		System.out.println(k-res);
	}
}

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

int main() {

  long long a, b, c;
  cin >> a >> b >> c;
  long long sum = 0;
  long long m = 1;
  long long ite = 0;
  
  bool possible = false;
  while (ite < 1000000) {
    if ( (m*a) % b == c ) {
      possible = true;
      break;
    }
    m++;
    ite++;
  }
  cout << ( possible ? "YES" : "NO" ) << endl;
 
  return 0;
}

Measured memory_bytes: 256
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		n: usize,
	}

	let f = n as f64;
	let r = f.sqrt();
	let i = r as usize;
	println!("{}", i*i);
}



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

using namespace std;

#define memset_clear(_) memset(_,0,sizeof(_))
#define memset_clear_tre(_) memset(_,1,sizeof(_))
#define memset_clear_reg(_) memset(_,-1,sizeof(_))
#define memset_clear_max(_) memset(_,0x3f,sizeof(_))
#define memset_clear_min(_) memset(_,0x80,sizeof(_))
#define sqr(_) ((_)*(_))

#define int long long

inline int read(){
	int ret=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9') {if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9') ret=ret*10+ch-'0',ch=getchar();
	return ret*f;
}

signed main(){
	int n=read(),m=read();
	printf("%lld\n",n-m+1);
	return 0;
}

Measured memory_bytes: 504
/*
 * @Author: Kaizyn
 * @Date: 2020-05-07 10:34:34
 * @LastEditTime: 2020-05-07 10:36:43
 */
#include <bits/stdc++.h>

// #define DEBUG

using namespace std;

const int N = 2e5+7;
const int MOD = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-7;
const double PI = acos(-1);
typedef pair<int, int> pii;

int n;
int a[N];
map<int, int> cnt;

signed main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    long long res = 0;
    for (int i = 1; i <= n; ++i) {
        res += cnt[-(a[i]-i)];
        ++cnt[a[i]+i];
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 21344
// " --- IN THE NAME OF ALLAH --- " // ;)
// -------------------------------- // ;)

#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <math.h>
#include <cmath>
#include <list>
#include <stack>
#include <bitset>
using namespace std;

typedef pair <long long int, long long int> pii;
typedef long double ld;
typedef long long int lli;
#define recout(x) return cout << (x), 0
#define re(x) return(x)
#define _f first
#define _s second
#define fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define stp(x) cout << setprecision(x) << fixed; 
const lli N = 1e6, N2 =  5e3 + 10, mod = 1e9 + 7, inf = 1e10;
const ld PI = 3.1415926535897932;
lli a[N], dp[N];
bool mark[N], vis[N];
//ld dou[N];
//vector <lli> v[N];
//queue <lli> q[N];
pii p[N];
//lli val[N];
//pair <ld, pii> p_3[N];
//string s[N];
//set <lli> s[N];
//char c[N];

int main() {
	fast;
	lli n, a, b;
	cin >> n >> a >> b;
	cout << min (a, b) << " ";
	lli c = a + b - n;
	if (c < 0)
		cout << 0;
	else
		cout << c;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define INF 0x3f3f3f3f
using namespace std;
int n,a,b;
int main()
{
	cin>>n>>a>>b;
	cout<<min(a,b)<<" ";
	if (a+b<=n) cout<<"0";
	else cout<<a+b-n;
	return 0;
}

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

#if __has_include(<local.h>)
#include <local.h>
#endif

using namespace std;

typedef long long int LL;
typedef long long int LLint;

//Faster Program
#define endl "\n"

//Faster Coding
#define ED return
#define GET(a) int a;cin >> a
#define DGET(a) double a;cin >> a
#define SGET(a) string a;cin >> a
#define CGET(a) char a;cin >> a
#define PRINT(a) cout << a << "\n"
#define ANS(a,b) int a;cin >> a;cout << b << "\n"
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define SORT(vec) sort(vec.begin(),vec.end())
#define REV(vec) reverse(vec.begin(),vec.end())
#define ALL(x) (x).begin(),(x).end()

//As Function
#define UP(a,b) ((a+(b-1))/b)
#define IPOW(x,y) LL(pow(x,y))

//Debug
#ifdef LOCAL_H
#define TEST cout << "OK\n"
#define DEBUG(a) a
#else
#define TEST
#define DEBUG(a)
#endif

#ifdef LOCAL_H
[[maybe_unused]]
#endif
const double PI = M_PI;
#ifdef LOCAL_H
[[maybe_unused]]
#endif
const int INF = int(999999999);
#ifdef LOCAL_H
[[maybe_unused]]
#endif
const long long MOD = int(1000000007);

//Settings
#ifdef LOCAL_H
const bool DO_BENCHMARK = true;
#endif
const int DOUBLE_ACCURACY = 15;

#ifndef LOCAL_H
const bool DO_BENCHMARK = false;
#endif

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(DOUBLE_ACCURACY);
    void solve();
    if(DO_BENCHMARK){
        clock_t clock_start = clock();
        solve();
        clock_t clock_end = clock();
        const double time = static_cast<double>(clock_end-clock_start)/CLOCKS_PER_SEC*1000.0;
        cout << "\n" << time << "[ms]\n";
    }
    else solve();
}

/************************************************************************************************************************************************/
void solve(){
    int N;
    cin >> N;
    int low = N%10;
    if(low == 3){
        cout << "bon" << endl;
    }
    else if(low == 0 || low == 1 || low == 6 || low == 8){
        cout << "pon" << endl;
    }
    else{
        cout << "hon" << endl;
    }
}



Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define all(v) ((v).begin()), ((v).end())
#define s(n) scanf("%d", &n)
#define sc(n) scanf("%c", &n)
#define sl(n) scanf("%lld", &n)
#define sf(n) scanf("%lf", &n)
#define ss(n) scanf("%s", n)
#define INF (int)1e9
#define EPS 1e-9
#define bitcount __builtin_popcount
#define gcd __gcd
#define n_mod(a, k) ((a % k) + k) % k
#define mod(a, k) (a % k)
#define sz(v) ((int)((v).size()))
#define clr(v, d) memset(v, d, sizeof(v))
#define rep(i, v) for (int i = 0; i < sz(v); ++i)
#define lp(i, n) for (int i = 0; i < (int)(n); ++i)
#define lpi(i, j, n) for (int i = (j); i < (int)(n); ++i)
#define lpd(i, j, n) for (int i = (j); i >= (int)(n); --i)
#define LSOne(S) (S & (-S))
#define repa(v) lpi(i, 0, sz(v)) lpi(j, 0, sz(v[i]))
#define P(x) cout << #x << " = { " << x << " }\n"
#define PB push_back
#define MP make_pair
#define M_PI 3.14159265358979323846
#define fast_IO                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define file_IO                       \
    freopen("input.txt", "r", stdin); \
    freopen("output.txt", "w", stdout)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<vd> vvd;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<string> vs;
int dcmp(double x, double y)
{
    return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1;
}
const int MAX = 1e5 + 10;
ll memo[MAX];
int arr[MAX];
int n, h;
ll dp(int i)
{
    if (i == n - 1)
    {
        return 0;
    }
    ll &ret = memo[i];
    if (ret != -1)
    {
        return ret;
    }
    ll path1 = INF;
    for (int j = 1; j <= 2; j++)
    {
        if (i + j < n)
        {
            path1 = min(path1, dp(i + j) + abs(arr[i] - arr[i + j]));
        }
    }
    return ret = path1;
}
int main()
{
    // #ifndef ONLINE_JUDGE
    //     file_IO;
    // #else
    //     fast_IO;
    // #endif
    fast_IO;
    clr(memo, -1);
    cin >> n;
    lp(i, n)
    {
        cin >> arr[i];
    }
    cout << dp(0) << '\n';
}

Measured memory_bytes: 6144
#include <iostream>
#include <vector>
// #include <algorithm>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

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

ll lcm(ll a, ll b){
    return a * b / gcd(a,b);
}

bool is753(int n){
    string s = to_string(n);
    if ((int)s.size() < 3)  {
        return false;
    }

    vi a(3,0);
    for (int i = 0; i < (int)s.size(); i++) {
        if (s[i] == '3') {
            a[0]++;
        }else if (s[i] == '5'){
            a[1]++;
        }else if (s[i] == '7'){
            a[2]++;
        }else{
            return false;
        }
    }

    for (int i = 0; i < 3; i++) {
        if (a[i] == 0) {
            return false;
        }
    }
    return true;
}

int N;
int dfs(string s){
    if (stol(s) > N) {
        return 0;
    }

    int ret = is753(stoi(s)) ? 1 : 0;
    string cand = "753";
    for (int i = 0; i < 3; i++) {
        string stmp = {cand[i]};
        ret += dfs(s + stmp);
    }
    return ret;
}


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

    if (n == 7 || n == 5 || n == 3) {
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }


    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}



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

#define MOD 1000000007
#define REP(i,n) for ((i)=0;i<(n);i++)
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define LL long long
#define ULL unsigned long long



int main(void) {

	long ans = 0;
	int n,i;
	scanf("%d", &n);

	for(i = 1; i<=n;i++){
		ans += i;
	}

	printf("%ld", ans);


	return 0;
}

/* 最後の改行忘れるな！！ */


Measured memory_bytes: 128
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
#include <stack>
#include <iomanip>
#include <limits>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
using edge= struct{int to;ll cost;};
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
typedef priority_queue<ll> PQ_HIGH;
typedef priority_queue<ll,VL,greater<ll>> PQ_LOW;//昇順

int main(){
  vector<vector<int>> c(3,vector<int>(3));
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      cin>>c[i][j];
    }
  }
  int pa1=c[0][1]-c[0][0];
  int pa2=c[0][2]-c[0][0];
  for(int i=0;i<3;i++){
    int t1=c[i][1]-c[i][0];
    int t2=c[i][2]-c[i][0];
    if(pa1==t1&&pa2==t2){
      continue;
    }else{
      cout<<"No"<<endl;
      return 0;
    }
  }
  pa1=c[1][0]-c[0][0];
  pa2=c[2][0]-c[0][0];
  for(int i=0;i<3;i++){
    int t1=c[1][i]-c[0][i];
    int t2=c[2][i]-c[0][i];
    if(pa1==t1&&pa2==t2){
      continue;
    }else{
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;

}

Measured memory_bytes: 3136
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#define MOD 1000000007
#define mkp make_pair
typedef long long ll;
using namespace std;

int dpx[2][16010];
int dpy[2][16010];

int main(){
  string S;
  cin>>S;
  int N=S.size();
  int X,Y;
  cin>>X>>Y;

  vector<int> x;
  vector<int> y;
  int t=0;
  int cnt=0;
  int fir=0;
  bool first=true;
  for(int i=0;i<N;i++){
      if(S[i]=='F') cnt++;
      else{
          if(first){
              first=false;
              fir=cnt;
              cnt=0;
              t=1-t;
              continue;
          }
          if(t==0) x.push_back(cnt);
          else y.push_back(cnt);
          cnt=0;
          t=1-t;
      }
  }
  if(cnt>0){
      if(first) fir=cnt;
      else if(t==0) x.push_back(cnt);
      else y.push_back(cnt);
  }


  X-=fir;
  int sum=0;
  dpx[0][8000]=1;
  t=0;
  for(int i=0;i<x.size();i++){
      int now=x[i];
      for(int j=-sum+8000;j<=sum+8000;j++){
          if(dpx[t][j]==0) continue;
          dpx[1-t][j-now]=1;
          dpx[1-t][j+now]=1;
      }
      sum+=now;
      for(int j=-sum+8000;j<=sum+8000;j++) dpx[t][j]=0;
      t=1-t;
  }

  dpy[0][8000]=1;
  sum=0;
  int ty=0;
  for(int i=0;i<y.size();i++){
      int now=y[i];
      for(int j=-sum+8000;j<=sum+8000;j++){
          if(dpy[ty][j]==0) continue;
          dpy[1-ty][j-now]=1;
          dpy[1-ty][j+now]=1;
      }
      sum+=now;
      for(int j=-sum+8000;j<=sum+8000;j++) dpy[ty][j]=0;
      ty=1-ty;
  }

  if(dpx[t][X+8000]&&dpy[ty][Y+8000]) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;


  return 0;
}


Measured memory_bytes: 384
<?php
/**
 * ABC120
 * A - Favorite Sound
 */

// $s = trim(fgets(STDIN));
// fscanf(STDIN, "%d %d", $a, $b);
// $n = array_map('intval', explode(' ', trim(fgets(STDIN))));

fscanf(STDIN, "%d %d %d", $A, $B, $C);

echo min(intdiv($B, $A), $C), PHP_EOL;


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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int

using namespace __gnu_pbds;

typedef tree<pair<ll,pair<ll,ll> >, null_type, less<pair<ll,pair<ll,ll> > >, rb_tree_tag, tree_order_statistics_node_update>ordered_set;


#define me BOSS
#define bug() cout<<"AIkahne aise"<<endl
#define PI acos(-1)
#define mod 1000000007
/* Precode Start Here *\


power of 2 less than or equal to N

ll largest_power(ll N)
{
    //changing all right side bits to 1.
    N = N (N>>1);
    N = N| (N>>2);
    N = N| (N>>4);
    N = N| (N>>8);


//as now the number is 2 * x-1, where x is required answer, so adding 1 and dividing it by
 2.
            return (N+1)>>1;

}


     Sieve
void sieve()
{
    for(ll i=3; i<=2000; i+=2)
    {
        for(ll j=i*i; j<=4000000; j+=i)
            A[j]=1;
    }
    v.push_back(2);
    for(ll i=3; i<=4000000; i+=2)
        if(A[i]==0)
            v.push_back(i);
}

     Power Function Modulo P

ll modPow(ll a, ll x, ll p) {
    //calculates a^x mod p in logarithmic time.
    long res = 1;
    while(x > 0) {
        if( x % 2 != 0) {
            res = (res * a) % p;
        }
        a = (a * a) % p;
        x /= 2;
    }
    return res;
}


   factorial

ll fact(ll n)
{
    ll ans=1;
    for(ll i=1;i<=n;i++)
    {
        ans=(ans*i)%mod;
    }
    return ans;
}
     Calculating nCr using Fermats law Theorem

ll modInverse(ll a, ll p) {
    //calculates the modular multiplicative of a mod m.
    //(assuming p is prime).
    return modPow(a, p-2, p);
}


ll modBinomial(ll n, ll k, ll p) {
// calculates C(n,k) mod p (assuming p is prime).

    ll numerator = 1; // n * (n-1) * ... * (n-k+1)
    for (ll i=0; i<k; i++) {
        numerator = (numerator * (n-i) ) % p;
    }

    ll denominator = 1; // k!
    for (ll i=1; i<=k; i++) {
        denominator = (denominator * i) % p;
    }

    // numerator / denominator mod p.
    return ( numerator* modInverse(denominator,p) ) % p;
}
     num of divisor and euler totient

ll phi[1000001],mark[1000001],divi[1000001];;
void divisorPhi(ll n)
{
    for(int i=1;i<=n;i++)
        phi[i]=i;
    for(int i=2;i<=n;i++)
    {
        if(!mark[i])
        {
            for(int j=i;j<=n;j+=i)
            {
                mark[j]=1;
                phi[j]*=(1-1/(double)i);
            }
        }
    }
    for(ll i=1;i<=n;i++)
    {
        for(ll j=i;j<=n;j+=i)
            divi[j]++;
    }
}




/* Precode Ends */
ll A[5000001],B[5000001];
vector<ll>v;
map<ll,ll>myMap;
set<ll>mySet;
vector<pair<ll,ll> >vp;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);

 ll n,ans=0,cnt=9999999999;
 cin>>n;
 for(int i=0;i<n;i++)
 cin>>A[i];

 for(int i=1;i<=n;i++)
 {
     if(cnt<A[i-1])
     {
         continue;
     }
     else
     {
         ans++;
         cnt=min(cnt,A[i-1]);
     }
 }
 cout<<ans<<endl;
return 0;
}




Measured memory_bytes: 2304
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

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

	int n;
	cin >> n;
	vector<vector<int>> a(n, vector<int> (n));
	vector<int> cl(n);
	vector<int> rw(n);
	int cc = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			char c;
			cin >> c;
			a[i][j] = (c == '#');
			cl[j] += a[i][j];
			rw[i] += a[i][j];
			cc |= a[i][j];
		}
	}
	if (!cc) {
		cout << -1 << endl;
		return 0;
	}
	int add = 0;
	for (int j = 0; j < n; j++) {
		add += (cl[j] < n);
	}
	int ans = 3 * n;
	for (int i = 0; i < n; i++) {
		int cur = 0;
		for (int j = 0; j < n; j++) {
			if (a[i][j]) continue;
			cur++;
		}
		cur += !cl[i];
		ans = min(ans, cur);
	}
	cout << add + ans << endl;
}


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

using namespace std;
using ll = long long;
using P = pair<int, int>;

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

int main() {
  ll n;
  cin >> n;
  vector<P> v;
  for (ll i = 2; i * i <= n; ++i) {
    int cnt = 0;
    while (n % i == 0) {
      n /= i;
      ++cnt;
    }
    if (cnt) v.push_back({i, cnt});
  }
  if (n != 1) v.push_back({n, 1});

  int ans = 0;
  for (auto p : v) {
    int s = p.second;
    int sum = 0;
    int cnt = 0;
    for (int i = 1; i <= s; ++i) {
      if (sum + i > s) break;
      sum += i;
      ++cnt;
    }
    ans += cnt;
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
    int N;
    cin >> N;
    vector<vector<int>> F(N, vector<int>(10));
    vector<vector<int>> P(N, vector<int>(11));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 10; j++) {
            cin >> F[i][j];
        }
    }
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 11; j++) {
            cin >> P[i][j];
        }
    }

    int res = -1000000000;
    for (int i = 1; i < (1 << 10); i++) {
        int profit = 0;
        for (int j = 0; j < N; j++) {
            int count = 0;
            for (int k = 0; k < 10; k++) {
                if ((i >> k) & 1 && F[j][k]) count++;
            }
            profit += P[j][count];
        }
        res = max(res, profit);
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
n,m,c = map(int,input().split())
B = list(map(int,input().split()))
A = [[ int(a)*b for a,b in zip(input().split(),B)] for _ in range(n)]
ans = 0
for a in A:
    if(sum(a) + c > 0 ):
        ans += 1
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <bitset>
#include <sstream>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <climits>
#include <ctype.h>
using namespace std;

#define PI acos(-1.0)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second

#define eps 1e-8
#define mod 998244353

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<vector<int>> vvi;

struct Matrix {
    vvi data;
    int r, c;
    Matrix(int row, int col, bool identity = false) : r(row), c(col) {
        data.assign(row, vector<int>(col, 0));
        if (identity) {
            for (int i = 0; i < r; ++i) {
                data[i][i] = 1;
            }
        }
    }
    Matrix operator * (Matrix& other) {
        int m = r, n = c, p = other.c;
        Matrix res(m, p);
        for (int i = 0; i < m; ++i) {
            for (int j = 0; j < p; ++j) {
                for (int k = 0; k < n; ++k) {
                    res.data[i][j] += data[i][k] * other.data[k][j];
                }
            }
        }
        return res;
    }
};

// 扩展欧几里得算法 res[1] * a + res[2] * b = res[0] = gcd(a, b)
vector<int> extendGcd(int a, int b) {
    if (b == 0) {
        return {a, 1, 0};
    } else {
        vector<int> tmp = extendGcd(b, a % b);
        return {tmp[0], tmp[2], tmp[1] - (a / b) * tmp[2]};
    }
}

// 矩阵快速幂
Matrix matrix_power(Matrix base, ll exp) {
    int n = base.r;
    Matrix res(n, n, true);
    while (exp) {
        if (exp & 1) {
            res = res * base;
        }
        base = base * base;
        exp >>= 1;
    }
    return res;
}

// 带模快速幂
ll power_mod(ll base, int exp) {
    ll res = 1;
    while (exp) {
        if (exp & 1) res = res * base % mod;
        base = base * base % mod;
        exp >>= 1;
    }
    return res;
}

// 快速幂
ll power(ll base, int exp) {
    ll res = 1;
    while (exp) {
        if (exp & 1) res *= base;
        base *= base;
        exp >>= 1;
    }
    return res;
}

// 求逆元
ll inv(ll a) {
    return power_mod(a, mod - 2);
}

#define MAXFAC 100010

ll fac[MAXFAC];

void initFac() {
    fac[0] = 1;
    for (int i = 1; i < MAXFAC; ++i) {
        fac[i] = i * fac[i - 1] % mod;
    }
}

ll Combine(ll a, ll b) {
    return (fac[a] * inv(fac[b]) % mod) * inv(fac[a - b]) % mod;
}

/******************************** template ********************************/
#define MAXN 100010

int main() {
    string s;
    cin >> s;
    cout << s.substr(0, s.length() - 8);

    return 0;
}

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

int main() {
    int a, n, card[4][13] = { {} }, x = 0, y = 0, k = 0, q[52], tmp;
    char ch,p[52];
     
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> ch >> a;
        if (ch == 'S') x = 1;
        else if (ch == 'H') x = 2;
        else if (ch == 'C') x = 3;
        else if (ch == 'D') x = 4;

        card[x - 1][a - 1] = 1;


    }
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 13; j++) {
            if (card[i][j] == 0) {
                if (i == 0) printf("S ");
                else if (i == 1) printf("H ");
                else if (i == 2) printf("C ");
                else if (i == 3) printf("D ");
                printf("%d\n", j + 1);
            }

        }
    }
    return 0;
}

/*
    for (int i = 0; i < n-1; i++) {
        for (int j = i; j < n; j++) {

           if (a[i] < a[j]) {
                tmp = a[i];
                a[i] = a[j];
                a[j] = tmp;
            }
        }
    }
            */


Measured memory_bytes: 3120
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def main():

    n, m, k = map(int, input().split()) 
    uf = UnionFind(n)
    no_cnt_list = [ set() for _ in range(n)]
    for i in range(m):
        a, b = map(int, input().split()) 
        uf.union(a-1,b-1)
        no_cnt_list[a-1].add(b-1)
        no_cnt_list[b-1].add(a-1)

    for i in range(k):
        c, d = map(int, input().split()) 
        if uf.same(c-1,d-1):
            no_cnt_list[c-1].add(d-1)
            no_cnt_list[d-1].add(c-1)

    ans_l = []
    for i in range(n):
        all_cnt = uf.size(i)
        ans = all_cnt - 1 - len(no_cnt_list[i])
        ans_l.append(ans)

    print(*ans_l)


if __name__ == "__main__":
    main()


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

 int main () {
   int a, b;
     
     while(1){
       cin >> a >> b;
       if ( a == 0 && b == 0) break;
           
           if ( a < b ){
            cout << a << " " << b << endl;
       } else {
         cout << b << " " << a << endl;
       }
     } 
           
    return 0;
 }    

Measured memory_bytes: 1160