akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1000000007
#define INF INT32_MAX / 2
#define PI 3.1415926

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;
}
template <class T>
T GCD(T a, T b) {
    if (b == 0)
        return a;
    else
        return GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
    return (a * b) / GCD(a, b);
}

using namespace std;
//#inculude <bits/stdc++.h>
//#define int long long

signed main() {
    double a, b, x;
    cin >> a >> b >> x;
    if (x == a * a * b) {
        cout << 0 << endl;
        return 0;
    }
    double ans;
    if (x > b * a * a / 2) {
        ans = b - (x / (a * a));
        ans *= 2 / a;
    }
    else {
        ans = a * b * b;
        ans /= 2 * x;
    }
    ans = atan(ans);
    ans = (ans * 180) / PI;
    cout << fixed << setprecision(10);
    cout << ans << endl;
}

Measured memory_bytes: 4036
#!/usr/bin/env python3

n, k = map(int, input().split())
a = list(map(int, input().split()))
assert len(a) == n

num = {}
for x in a:
    if x in num:
        num[x] += 1
    else:
        num[x] = 1

nums = []
for x in num:
    nums.append(num[x])
nums = sorted(nums)

res = sum(nums[:len(nums) - k])

print(res)


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

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

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

  int n; cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];

  int odd = 0, div2 = 0, div4 = 0;
  rep(i, n) {
    if(a[i]%4 != 0 && a[i]%2 == 0) div2++;
    if(a[i]%4 == 0) div4++;
    if(a[i]&1) odd++;

    if(odd == 0) {
      cout << "Yes" << '\n';
      return 0;
    }
  }

  cout << (div4+1 >= odd+div2 ? "Yes" : "No") << '\n';
  return 0;
}


Measured memory_bytes: 1024
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < n; i++)

using namespace std;

void solve() {
  long N;
  string S;
  cin >> N >> S;
  long x = 0;
  long ans = x;
  for (char c: S) {
    if (c == 'I') x++;
    else x--;
    ans = max(ans, x);
  }
  cout << ans << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


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

struct StRequir
{
  StRequir() :
    m_nBgn(0), m_nEnd(0), m_nDiff(0), m_nPoint(0) { }

  int m_nBgn;
  int m_nEnd;
  int m_nDiff;
  int m_nPoint;
};

void fnInput(int& rnSeqSiz, int& rnMaxNum, vector<StRequir>& rvoRequir)
{
  int nReqSiz;
  cin >> rnSeqSiz >> rnMaxNum >> nReqSiz;
  rvoRequir.resize(nReqSiz);

  for (StRequir& roRequir : rvoRequir)
    cin >> roRequir.m_nBgn >> roRequir.m_nEnd >> roRequir.m_nDiff >> roRequir.m_nPoint;
}
  
void fnDfsSeqMake(int nPos, int nMaxNum, vector<int>& rvnSeq,
                  const vector<StRequir>& cnrvoRequir, int& rnMaxPoint)
{
  if (nPos == rvnSeq.size())
  {
    int nPoint = 0;

    for (StRequir oRequir : cnrvoRequir)
      if (rvnSeq[ oRequir.m_nEnd - 1 ] - rvnSeq[ oRequir.m_nBgn - 1 ] == oRequir.m_nDiff)
        nPoint += oRequir.m_nPoint;

    rnMaxPoint = max(rnMaxPoint, nPoint);
    return;
  }

  if (nPos > 0)
    rvnSeq[nPos] = rvnSeq[ nPos - 1 ];

  while (rvnSeq[nPos] <= nMaxNum)
  {
    fnDfsSeqMake(nPos + 1, nMaxNum, rvnSeq, cnrvoRequir, rnMaxPoint);
    rvnSeq[nPos]++;
  }
}

int fnMaxPointGet(int nSeqSiz, int nMaxNum, const vector<StRequir>& cnrvoRequir)
{
  int nMaxPoint = 0;
  vector<int> vnSeq(nSeqSiz, 1);

  fnDfsSeqMake(0, nMaxNum, vnSeq, cnrvoRequir, nMaxPoint);
  return nMaxPoint;
}
  
int main()
{
  int nSeqSiz, nMaxNum;
  vector<StRequir> voRequir;

  fnInput(nSeqSiz, nMaxNum, voRequir);
  cout << fnMaxPointGet(nSeqSiz, nMaxNum, voRequir) << endl;

  return 0;
}

Measured memory_bytes: 3632
n = int(input())
lst = list()
 
while True:
  a, b = divmod(n, 26)
  n = a
  lst.append(b)
  if a == 0:
    break
 
for i in range(len(lst) - 1):
  if lst[i] <= 0:
    lst[i] += 26
    lst[i + 1] -= 1
 
if lst[-1] == 0:
  lst.pop()
 
for i in range(len(lst)):
  lst[i] = chr(lst[i] + 96)
 
print("".join(lst[::-1]))

Measured memory_bytes: 9092
#include <bits/stdc++.h>
using namespace std;
 
int main() 
{
  int N, n, g=0, r;
  cin >> N;
  n = N;
  for (int i=8; i>=0; i--)
  {
    r=1;
    for (int j=0; j<i; j++)
    {
      r *= 10;
    }
    g += N / r;
    N -= (N / r) * r;
  }
 
  if (n % g ==0)
  {
    cout << "Yes" << endl;
  }
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
def main():
    n = int(input())
    s = []
    a,w,t,r = 0,0,0,0
    for i in range(n):
        tmp = input()
        if tmp=='AC':
           a+=1
        elif tmp=='WA':
            w+=1
        elif tmp=='TLE':
            t += 1
        else:
            r+=1
    print('AC x',a)
    print('WA x',w)
    print('TLE x',t)
    print('RE x',r)
main()

Measured memory_bytes: 8996
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
using namespace std;
const int LEN=100005;

typedef struct pp{
	char name[100];
	int t;
}p; 

p Q[LEN];
int head,tail,n;

void enqueue(p x)
{
	Q[tail]=x;
	tail=(tail+1)%LEN;
}

p dequeue()
{
	p x=Q[head];
	head=(head+1)%LEN;
	return x;
}

int min(int a, int b)
{
	return a<b?a:b;
}

int main(void) 
{
	int elaps=0,c,q;
	p u;
	cin >> n >> q;
	//cout <<n << q<< endl;
	
	for(int i=1;i<=n;i++){
		cin >> Q[i].name;
		cin >> Q[i].t;
		getchar();
		//cout <<Q[i].name << Q[i].t << endl;
	}
	head=1;
	tail=n+1;
	while(head!=tail){
		u=dequeue();
		c=min(q,u.t);
		u.t-=c;
		elaps+=c;
		if(u.t>0)
			enqueue(u);
		else
			cout << u.name << " " << elaps << endl;
	}

	return 0;
}


Measured memory_bytes: 13232
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <cmath>
using namespace std;
typedef long long ll;
//typedef pair<ll, ll> P;

#define rep(i, m) for(ll i=0;i<(m);i++)
#define rep1(i, m) for(ll i=1;i<=(m);i++)
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

ll H, W;
char s[60][60];

int main() {
   cin >> H >> W;
   rep1(i, H) {
      cin >> &s[i][1];
   }
   rep1(i, H) {
      rep1(j, W) {
         if (s[i][j] == '.') {
            continue;
         } 
         int isexist = 0;
         isexist += (s[i-1][j] == '#');
         isexist += (s[i+1][j] == '#');
         isexist += (s[i][j-1] == '#');
         isexist += (s[i][j+1] == '#');
         if (isexist <= 0) {
            cout << "No" << endl;
            return 0;
         }
      }
   }
   cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <limits>
#include <climits>
#include <utility>
#include <algorithm>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

template<class T>
bool is_prime(T x)
{
    if (x == 2) {
        return true;
    }

    if (x % 2 == 0) {
        return false;
    }

    for (T i = 3; i * i <= x; i += 2) {
        if (x % i == 0) {
            return false;
        }
    }

    return true;
}

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

    unordered_map<int, int> primes;
    for (int i = 2; i <= 100; ++i) {
        if (is_prime(i)) {
            primes[i] = 0;
        }
    }

    for (int i = 1; i <= N; ++i) {
        int n = i;
        for (auto&& p : primes) {
            while (n % p.first == 0) {
                p.second++;
                n /= p.first;
            }
        }
    }

    int ans = 0;

    auto num = [&primes](int m){
        return count_if(begin(primes), end(primes), [m](const auto& p){ return p.second >= m-1; });
    };

    ans += num(75);
    ans += num(25) * (num(3) - 1);
    ans += num(15) * (num(5) - 1);
    ans += num( 5) * (num(5) - 1) * (num(3) - 2) / 2;

    cout << ans << endl;

    return 0;
}


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

long n,ans=0,wkazu=0,kyori=0;
string c;
bool sitentansaku=true;
vector<long> x(99999),y(99999);
vector<set<long>> ki(100000,set<long>());
vector<bool> tansaku2b(100000,true);

void tansaku1(long i) {
  if(ki[i].size()!=1) return;
  if(c[i]=='B') {
    ki[*(ki[i].begin())].erase(i);
    tansaku1(*(ki[i].begin()));
    ki[i].erase(ki[i].begin());
  }
  return;
}

long tansaku2(long a,long b) {
  tansaku2b[a]=false;
  long m1=b,m2=b,m3=0;
  long aaa=b;
  if(ki[a].size()%2==0&&c[a]=='W') b+=2;
  if(ki[a].size()%2==1&&c[a]=='B') b+=2;
  for(auto itr=ki[a].begin();itr!=ki[a].end();itr++) {
    if(tansaku2b[*(itr)]) m3=tansaku2(*(itr),b);
    if(m3>m2) swap(m2,m3);
    if(m2>m1) swap(m1,m2);
  }
  kyori=max(kyori,m1+m2-b-aaa);
  return m1;
}

int main() {
  cin >> n;
  for(long i=0;i<n-1;i++) {
    cin >> x[i] >> y[i];
    ki[x[i]-1].insert(y[i]-1);
    ki[y[i]-1].insert(x[i]-1);
  }
  cin >> c;
  for(long i=0;i<n;i++) if(c[i]=='W') wkazu++;
  if(wkazu<=1) {
    cout << wkazu << endl;
    return 0;
  }
  for(long i=0;i<n;i++) {
    tansaku1(i);
  }
  bool bo=true;
  for(long i=0;i<n;i++) {
    ans+=ki[i].size();
    if(ki[i].size()%2==0&&c[i]=='W') ans++;
    if(ki[i].size()%2==1&&c[i]=='B') ans++;
    if(bo&&ki[i].size()>0) {
      tansaku2(i,0);
      bo=false;
    }
  }
  ans-=kyori;
  cout << ans << endl;
}

Measured memory_bytes: 25876
#include <cstdio>
#include <algorithm>
using namespace std;
#define N 100010
#define mod 1000000007
int fr[N],to[N],fa[N],id[N],n,m; long long val[N],mn;
int find(int x) {return fa[x]==x?x:fa[x]=find(fa[x]);}
bool cmp(const int &a,const int &b) {return val[a]<val[b];}
long long kruscal(int now)
{
	for(int i=1;i<=n;i++) fa[i]=i; long long ans=0;
	if(now) fa[fr[id[now]]]=to[id[now]],ans+=val[id[now]];
	for(int i=1;i<=m;i++)
	{
		if(find(fr[id[i]])!=find(to[id[i]]))
			fa[find(fr[id[i]])]=find(to[id[i]]),ans+=val[id[i]];
	} return ans;
}
long long qpow(long long x,long long y) {long long tmp=1;while(y) {if(y&1) (tmp*=x)%=mod;y>>=1,(x*=x)%=mod;}return tmp;}
int main()
{
	scanf("%d%d%lld",&n,&m,&val[0]);
	for(int i=1;i<=m;i++) scanf("%d%d%lld",&fr[i],&to[i],&val[i]),id[i]=i;
	sort(id+1,id+m+1,cmp),mn=kruscal(0);
	if(val[0]<mn) printf("0\n"),exit(0);
	if(val[0]==mn)
	{
		int many1=0,many2=0;
		for(int i=1;i<=m;i++) (kruscal(i)==mn)?many1++:many2++;
		printf("%lld\n",(1ll*(qpow(2,many1)-2)*qpow(2,many2)%mod+mod)%mod);
	}
	if(val[0]>mn)
	{
		int many1=0,many2=0;
		for(int i=1;i<=m;i++) (kruscal(i)==val[0])?many1++:many2+=(kruscal(i)>val[0]);
		printf("%lld\n",(2ll*(qpow(2,many1)-1)*qpow(2,many2)%mod+mod)%mod);
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll INF = 1e18;
/* テンプレートここまで */

int main() {
  ll H, W; cin >> H >> W;
  vector<string> s(H); 
  REP(i, H) cin >> s[i];
  
  REP(i, W+2) cout << "#";
  cout << endl;

  REP(i, H){
    cout << "#";
    cout << s[i];
    cout << "#";
    cout << endl;
  }

  REP(i, W+2) cout << "#";
  cout << endl; 
}

Measured memory_bytes: 256
package main

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

func main() {
	var o, e string
	fmt.Scan(&o, &e)

	var wr = bufio.NewWriter(os.Stdout)
	for i := 0; i < len(o); i++ {
		if i < len(e) {
			wr.WriteString(o[i : i+1])
			wr.WriteString(e[i : i+1])
		} else {
			wr.WriteString(o[i : i+1])
		}
	}
	wr.WriteString("\n")
	wr.Flush()
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define fo(i,n)         for(int i=0;i<n;i++)
#define Fo(i,k,n)       for(int i=k;i<n;i++) 
#define endl            "\n"
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define vec(x)          vector<x>
#define matrix(x)       vector<vector<x>>
#define sz(x) 			(int)x.size()
#define mem(a,b)        memset(a, b, sizeof a)
#define vii             vector<pair<int,int>>
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define gcd(a,b)        __gcd(a,b)
#define lcm(a,b)        (a*(b/gcd(a,b)))
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define MOD             998244353
#define deb(x)          cerr <<#x<<" = "<<x<<"\n"
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(v)          v.begin(),v.end()
#define rep(i,a,b)      for (int i = a; i<b; ++i)
#define len(s)          s.length()
#define watch(x) 		cout << #x << " = " << x << endl
#define trace(x) 		cerr << #x << " = " << x << endl
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
 
int power(int a,int b,int m=mod)
{int ans=1;while(b>0){if(b&1)ans=(ans*a)%m;a=(a*a)%m;b>>=1;}
return ans;}

void angshuGod()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

const int N = 1e4;
const double pi = acos(-1);

void solve(){
    
	int cnt = 0;
	int l,r,d; cin>>l>>r>>d;
	for(int i = l;i<=r;i++){
		if(i%d==0) cnt++;
	}
	cout<<cnt;
}

 
int32_t main()
{
    angshuGod();

    int t;

    t = 1;
    //cin>>t;

    while(t--){
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define vl vector<ll>
#define vpl vector<pair<ll,ll>>
#include <algorithm>//__gcd(a,b)
#include <iostream>
#include <cmath>//abs

int main(){
ll n;cin>>n;
vl h(n);rep(i,n)cin>>h[i];

vl d(n);d[0]=0;d[1]=abs(h[1]-h[0]);
for(ll i=2;i<n;i++)d[i]=min(d[i-1]+abs(h[i]-h[i-1]),d[i-2]+abs(h[i]-h[i-2]));

cout<<d[n-1]<<endl;

}

Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Linq;

public class S
{

    private const long DP_INIT_MINUS1 = -1;
    private const double DP_INIT_DOUBLE_MINUS1 = -1.0;
	private const long MOD = 1000000007;


    public static void Main()
	{
		/*
        var input = Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        var N = input[0];
        var M = input[1];
        */

        var input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        var N = input[0];
        var K = input[1];
        /*
            ABC 131 E FriendShips

            解説ACの民。
            確かにスター形にすれば距離2を最大数作れるのは分かるんだけど、
            そこからどう数を「削る」かが分からなかった。
            
            辺数は指定されてないんだから適当なところは繋げてつぶせば良かったんだね。

            で、実装できますか？　という話だよね。解けないのもだめだけど、解説だけ見て
            分かった気になって本番実装できないのはやばいので書きましょう。
            
        */

        var X = N-1;
        var path = (X*(X-1))/2;
        var pathCount = 0;
        if(K > path){
            Console.WriteLine(-1);
            return;
        }

        var rootA = new int[10000];
        var targetA = new int[10000];


        
        var root = 2;
        var target = 3;

        while(path != K){
            rootA[pathCount] = root;
            targetA[pathCount] = target;
            path--;
            target++;
            pathCount++;
            if(target > N){
                root++;
                target = root+1;
            }
        }

        Console.WriteLine(pathCount + X);
        for(int i = 2; i <= N; i++){
            Console.WriteLine("1 " + i);
        }
        for(int i = 0; i < pathCount; i++){
            Console.WriteLine(rootA[i] + " " + targetA[i]);
        }



        
    }

}

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

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

using namespace std;
using ll = long long int;
const int inf = 1001001000;
const long long int Inf = 1001001001001001000;

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

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

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

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

int main()
{
	long long int n, k;
	cin >> n >> k;
	cout << min(abs(n - (n / k) * k), abs(n - (n / k + 1) * k)) << endl;
	return 0;
}

Measured memory_bytes: 256
/**
 * @author: Mackenzie
**/
#include <bits/stdc++.h>

using namespace std;

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main() {
#ifdef LOCAL
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#else
    fastIO;
#endif
    int n, k;
    cin >> n >> k;
    vector<int> h(n);
    forn(i, n) cin >> h[i];
    sort(rall(h));
    ll ans = 0;
    for (int i = k; i < n; i++) {
        ans += h[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
while True:
    n = int(raw_input())
    if n == 0:
        break
    a = [0]
    for i in range(n):
        a.append(int(raw_input()) + a[-1])
    mx = -100000
    for i in range(n):
        for j in range(i + 1, n + 1):
            mx = max(mx, a[j] - a[i])
    print mx

Measured memory_bytes: 4472
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			long n = sc.nextLong();
			StringBuilder result = new StringBuilder();
			long tmp = 0;
			do {
				n -= 1;
				tmp = n % 26;
				result.append((char)('a' + tmp));
				n /= 26;
			} while(1 <= n);
			System.out.println(result.reverse().toString());
		}
	}
}


Measured memory_bytes: 35792
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N):
    if max(A[:i+1]) <= A[i]:
        ans += 1
print(ans)


Measured memory_bytes: 2940
main :: IO ()
main = interact $ unlines . map (eval . map read . words) . init . lines

eval :: [Int] -> String
eval [m,f,r]
    | m == -1 || f == -1 || s < 30 = "F"
    | s >= 80 = "A"
    | s >= 65 = "B"
    | s >= 50 || r >= 50 = "C"
    | otherwise = "D"
    where s = m + f


Measured memory_bytes: 4004
#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;
    cout << (e - a > k ? ":(" : "Yay!") << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector< vector<int> > VVI;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()

int main() {
  int N;
  cin>>N;
  VI A(N);
  rep(i,N) cin>>A[i];
  vector<P> B;
  rep(i,N) B.push_back(make_pair(A[i],i));
  sort(all(B));
  rep(i,N){
    if(i) cout<<" ";
    cout<<B[i].second+1;
  }
  cout<<endl;
}



Measured memory_bytes: 2164
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

int main() {
    ll n;
    cin >> n;
    ll a[n], b[n];
    rep(i,n){
        cin >> a[i] >> b[i];
    }
    sort(a,a+n);
    sort(b,b+n);

    ll ans = 0;

    if(n % 2 == 1){
        ans = b[n/2] - a[n/2] + 1;
    }else{
        ans = (b[n/2]+b[n/2-1]) - (a[n/2]+a[n/2-1]) + 1;
    }

    cout << ans << endl;
    return 0;
}





Measured memory_bytes: 6764
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        scanner.close();

        int ans = 0;
        for(int i = 1; i <= N; i += 2) {
            int tmp = 0;
            for(int j = 1; j <= i; j++) {
                if(i % j == 0) {
                    tmp++;
                }
            }
            if(tmp == 8) ans++;
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n)    for(int i=a; i<=n; ++i)
#define rep1(i,a,n)   for(int i=a; i>=n; --i)
#define pb            push_back
#define int           long long
#define fr            first
#define sc            second
#define vc            vector
#define sz(v)         (int)v.size()
#define all(x)        (x).begin(),(x).end()
#define M             1000000007
#define MM            998244353
#define PI            3.14159265358979
#define INF           1000000000000000

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mii;

int n,m,ans; string str;

vi v[2005];
int d[2005];
int a[2005][2005];
int v2[2005];
void bfs(int s){
    rep(i,0,n){
        d[i]=INF;
        v2[i]=0;
    }
    queue<int> q;
    q.push(s);
    d[s]=0;
    while(!q.empty()){
        int t=q.front();
        q.pop();
        if(v2[t]) continue;
        v2[t]=1;
        for(auto x:v[t]){
            q.push(x);
            if(d[t]+1<d[x]){
                d[x]=d[t]+1;
            }
        }
    }
}
int solve(){
    cin>>n;
    rep(i,1,n){
        rep(j,1,n){
            a[i][j]=INF;
        }
    }
    rep(i,2,n){
        v[i].pb(i-1);
        v[i-1].pb(i);
    }
    int x,y; cin>>x>>y;
    v[x].pb(y);
    v[y].pb(x);
    rep(i,1,n){
        bfs(i);
        rep(j,1,n){
            a[i][j]=min(a[i][j],d[j]);
        }
    }
    int ans[n]={};
    rep(i,1,n){
        rep(j,i+1,n){
            ans[a[i][j]]++;
            // cout<<a[i][j]<<" ";
        }
        // cout<<"\n";
    }
    rep(i,1,n-1) cout<<ans[i]<<"\n";
    return 0;
}

signed main() {
    ios::sync_with_stdio(0);
    //std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t=1;
    // cin>>t;
    while(t--) solve();
    return 0;
}

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

#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define vi vector<int>
#define vll vector<long long>
#define ll long long
#define ull unsigned long long
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(NULL)
#define nl cout<<'\n'
#define pb push_back
#define mp make_pair
#define pi pair<int,int>
#define pll pair<long long,long long>
#define vpii vector<pair<int,int> >
#define vpll vector<pair<ll,ll> >
#define si set<int>
#define sll set<long long>
#define all(v) (v).begin(),(v).end()
#define Unique(x)           (x).erase(unique(all(x)), x.end())
#define v_present(vec,x)  (find(all(vec),x)!=(vec).end())
#define present(myset,x)    ((myset).find(x)!=(myset).end())
#define Cprint(c)  for(auto i:(c)) { cout<<i<<" "; } nl
#define trace2(x,y) cout<<x<<" "<<y<<endl;
#define trace3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define trace4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<" "<<a<<endl;
ll mod = 1e9+7;
const int MAX = 1e5+5;
using namespace std;
ll dp[105][100005];

int main()
{
    FAST_IO;
    ll n,W;
    cin>>n>>W;
    ll w[n+1]; ll v[n+1];
    for(int i=1;i<=n;i++){
        cin>>w[i]>>v[i];
    }
    //memset(dp,1e15,sizeof(dp));
    for(int i=0;i<=n;i++){
       for(int val=0;val<=1e5+5;val++){
           if(val==0){
               dp[i][val]=0;
               continue;
           }
           else if(i==0){
               dp[i][val]=1e15;
               continue;
           }

           if(v[i]<=val)
           dp[i][val]=min(dp[i-1][val],dp[i-1][val-v[i]]+w[i]);
           else
               dp[i][val]=dp[i-1][val];
       }
    }
    for(int val=1e5;val>=1;val--){
        if(dp[n][val]<=W){
            cout<<val;
            return 0;
        }
    }


    return 0;

}


Measured memory_bytes: 80128
import java.util.HashSet;
import java.util.Set;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String[] ans = new String[3];
        for (int i = 0; i < 3; i++) {
            if (line.charAt(i) == '1') {
                ans[i] = "9"; 
            }
            if (line.charAt(i) == '9') {
                ans[i] = "1"; 
            }
        }
        
        String a = String.join("", ans);
        
        System.out.println(a);
    }
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,1,0,-1},dy={-1,0,1,0};
bool inside(int y,int x,int h,int w){
	if(y<h && y>=0 && x<w && x>=0) return true;
	return false;
}





int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;cin >> s;
	int n = s.size();
	ll ans = 0;
	vector<int> a(n + 1);
	rep(i,n){
		int j = i + 1;
		for(; j < n; j++){
			if(s.at(i) != s.at(j)) break;
		}
		int k = j - i;
		if(s.at(i) == '<'){
			while(i < j){
				a.at(i) = max(a.at(i), k - (j - i));
				i++;
			}
			a.at(j) = max(a.at(j), k);
		}
		else{
			while(i < j){
				a.at(i) = max(a.at(i), j - i);
				i++;
			}
		}
		i--;
	}
	rep(i,n + 1) ans += a.at(i);
	cout << ans << endl;
}

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

int main() {
	int N;
	cin >> N;
	
	for(int i=0; i<N; i++){
		int a,b,c;
		cin >>a>>b>>c;
		
		if(a*a+b*b==c*c || b*b+c*c==a*a || c*c+a*a==b*b){cout << "YES" <<endl;}
		else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1152
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>
#include <set>
#include <map>

using namespace std;

#define EPS 1e-14
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) FOR(i, 0, n)
#define PI 2*acos(0.0)
#define ALL(a) (a).begin(),(a).end()
#define DEBUG(x) cout<<#x <<": "<< x << "\n"
#define DEBUG_ARR(a) REP(i, size(a)){ cout << #a << "[" << i << "]: " << a[i] << "\n"; }
const int VX[] = { 0, 1, 0, -1 };
const int VY[] = { 1, 0, -1, 0 };
const long MOD = 1000000007;

typedef long long ll;

int main() {
	//	--- I/O 高速化 ---
	cin.tie(0);
	ios::sync_with_stdio(false);
	// --- ここまで ---

	string O, E;
	cin >> O >> E;

	for (int i = 0; i < O.length() + E.length(); i++) {
		if (i % 2 == 0) {
			cout << O[i / 2];
		}
		else {
			cout << E[i / 2];
		}

	}

	return 0;
}



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

int main() {
    int N;
    cin >> N;
    map <string, int> A;
    for (int i=0; i<N; i++){
        string s;
        cin >> s;
        if (A.count(s)){
            A[s]++;
        }
        else {
            A[s]=1;
        }
    }
    int count=0;
    cout << A.size() << endl;
}

Measured memory_bytes: 19204
sa=input()
sb=input()
sc=input()
la=[]
lb=[]
lc=[]
for i in range(len(sa)):
  la.append(sa[i])
for i in range(len(sb)):
  lb.append(sb[i])
for i in range(len(sc)):
  lc.append(sc[i])
j=0
while 1:
  if j==0:
    if len(la)==0:
      print('A')
      exit()
    else:
      if la[0]=='b':
        j=1
      if la[0]=='c':
        j=2
      la.remove(la[0])
  elif j==1:
    if len(lb)==0:
      print('B')
      exit()
    else:
      if lb[0]=='a':
        j=0
      if lb[0]=='c':
        j=2
      lb.remove(lb[0])
  else:
    if len(lc)==0:
      print('C')
      exit()
    else:
      if lc[0]=='b':
        j=1
      if lc[0]=='a':
        j=0
      lc.remove(lc[0])

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

int main()
{
    int n;
    cin >> n;
    for(int i = 0; i < 11; i++)
    {
        if(n - 1000 < 0)
            break;
        else
            n = n - 1000;
        //cout << "n: " << n << endl;
    }
    if(n == 0)
    {
        cout << 0 << endl;
    }
    else
        cout << 1000 - n << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
int main() {
  int X, A, B;
  cin >> X >> A >> B;
  if(A >= B) {
    cout << "delicious" << endl;
  }
  else if((X + A) >= B) {
    cout << "safe" << endl;
  }
  else {
    cout << "dangerous" << endl;
  }
}


Measured memory_bytes: 3552
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;

int main() {
  ll w,h,x,y;
  cin >> w >> h >> x >> y;
  ll check=0;
  if(x*2==w&&y*2==h) {
    check=1;
  }
  cout << fixed << setprecision(10) << w*h/2.0 << " " << check << endl;
}

Measured memory_bytes: 256
import numpy as np

if __name__ == '__main__':
	N = int(input())
	dam = np.array(list(map(int, input().split())))
	
	index_ = np.array([1 if i % 2 == 0 else -1 for i in range(N)])
	ans = [int(np.dot(dam, index_))]
	for i in range(N-1):
		ans.append(2 * (dam[i] - ans[i]//2))
	ans = [str(i) for i in ans]
	print(' '.join(ans))

Measured memory_bytes: 26060
/*
  Contest 079
  B - Lucas Number
  Rakesh Kumar --> 13/09/2020
 */

#include <bits/stdc++.h>

using ull = unsigned long long int;

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

    int n = 0;
    std::cin >> n;

    ull a = 2;
    ull b = 1;
    ull c = 1;
    for (int i = 2; i <= n; ++i) {
        c = a + b;
        a = b; b = c;
    }
    std::cout << c << std::endl;

    return 0;
}


Measured memory_bytes: 3600
#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>

using namespace std;

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

    int A, B;
    while(cin >> A >> B) {
        vector<int> dim(200, 0);
        do {
            dim[A-1]++;
            dim[B-1]++;
            cin >> A >> B;
        } while(A != 0 || B != 0);
        int odds = 0;
        for(int i = 0; i < 200; ++i) {
            if(dim[i] % 2 == 1) ++odds;
        }
        if(dim[0] % 2 == 1 && dim[1] % 2 == 1 && odds == 2) {
            cout << "OK" << endl;
        } else {
            cout << "NG" << endl;
        }
    }
    return 0;
}

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

int main()
{
   double W,H,x,y; cin>>W>>H>>x>>y;
   double ans=H*W/2;
   bool exist=false;
   if(H/2==y and W/2==x) exist=true;
   cout<<fixed<<setprecision(10)<<ans<<' '<<exist<<endl;
   return 0;
}


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

int main() {
	int N, K; cin >> N >> K;
	vector<int> h(N);
	for (int i = 0; i < N; i++) cin >> h[i];

	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (h[i] >= K) ans++;
	}

	cout << ans << endl;
}

Measured memory_bytes: 640
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

const int mod = 1000000007;
//const int mod = 998244353;

struct mint {
    int64_t x;
    mint(int64_t x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(int64_t t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    //for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) {return mint(*this) /= a;}
};

istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {
    vector<mint> frac, ifrac;
    combination(int n):frac(n+1), ifrac(n+1) {
        assert(n < mod);
        frac[0] = 1;
        for (int i = 1; i <= n; ++i) frac[i] = frac[i-1]*i;
        ifrac[n] = frac[n].inv();
        for (int i = n; i >= 1; --i) ifrac[i-1] = ifrac[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return frac[n]*ifrac[k]*ifrac[n-k];
    }
} c(100);

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    
    mint dp[n-2][4][4][4];
    rep(i, 4) {
        rep(j, 4) {
            rep(k, 4) {
                if(i == 0 and (j == 2 and k == 1 or j == 1 and k == 2) or i == 2 and j == 0 and k == 1) continue;
                dp[0][i][j][k] = 1;
            }
        }
    }
    
    rep(ii, n-3) {
        rep(i, 4) rep(j, 4) rep(k, 4) {
            if(i == 0 and (j == 2 and k == 1 or j == 1 and k == 2) or i == 2 and j == 0 and k == 1) continue;
            rep(l, 4) {
                if(l == 0 and j == 2 and k == 1 or l == 0 and i == 2 and k == 1) continue;
                dp[ii+1][i][j][k] += dp[ii][l][i][j];
            }
        }
    }

    mint ans = 0;
    rep(i, 4) rep(j, 4) rep(k, 4) {
        ans += dp[n-3][i][j][k];
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
//============================================================================
// Name        : c.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<set>
#include<vector>
using namespace std;

int main() {
	int n;cin>>n;
	vector<int> p(n);
	int min=1000000;
	int ans=0;
	for(int i=0;i<n;i++){
		cin>>p[i];
		if(min>=p[i]){
			ans++;
			min=p[i];
		}

	}
	cout<<ans<<endl;
	return 0;
}


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

using namespace std;

#define INF (int)(1e9)

// The recurrence we will be optimizing is
// c(n) = min(c(n - 1) + cost(n, n - 1),
//            c(n - 2) + cost(n, n - 2))

// h[i] is the "value" of stone i
// cost(i, j) = abs(h[i] - h[j])

// I think this way is more natural
int solve_backwards(const vector<int> &h, int N) {
	if (N < 0)
		return INF;
	if (N == 0)
		return 0;

	return min(solve_backwards(h, N - 1) + abs(h[N] - h[N - 1]),
		   solve_backwards(h, N - 2) + abs(h[N] - h[N - 2]));
}

int solve_forwards(const vector<int> &h, int N) {
	if ((size_t)N >= h.size())
		return INF;
	if ((size_t)N == h.size() - 1)
		return 0;

	return min(solve_forwards(h, N + 1) + abs(h[N] - h[N + 1]),
		   solve_forwards(h, N + 2) + abs(h[N] - h[N + 2]));
}

// position -> cost
// the shortest path to i will inform us about the shortest
// path to get to i + 1 and i + 2
// this will solve to the shortest path to N in general
// This is really just adding a cache to the original
// brute force recurrence
// Easiest way to apply DP in general
unordered_map<int, int> map_dp;
int solve_memo(const vector<int> &h, int N) {
	if (map_dp.find(N) != map_dp.end())
		return map_dp[N];

	if (N < 0)
		return INF;
	if (N == 0)
		return 0;

	return map_dp[N] = min(solve_memo(h, N - 1) + abs(h[N] - h[N - 1]),
			       solve_memo(h, N - 2) + abs(h[N] - h[N - 2]));
}

// Same idea as last time
// Instead of doing it top down, we will do it bottom up
// Building up smaller values of this optimization first and using
// them to find the answer for N
// This is just changing the order
// You need to know the order of your computations for this to work.
// This case is easy. Generally this means topologically sorting your
// computations
// If this is hard, you may just want to do something like solve_memo.
int solve_tab(const vector<int> &h, int N) {
	vector<int> dp(N);

	// Initial conditions
	dp[0] = 0;
	// This is here because so
	// the recurrence doesn't reach too
	// far back with indices
	dp[1] = abs(h[0] - h[1]);

	// Original recurrence
	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]));
	}

	return dp[N - 1];
}

int main() {

	cin.tie(NULL);
	ios_base::sync_with_stdio(false);

	int N;
	cin >> N;
	vector<int> h(N);
	for (auto &e : h) {
		cin >> e;
	}
	// cout << solve_backwards(h, N - 1) << '\n';
	// cout << solve_forwards(h, 0) << '\n';
	cout << solve_memo(h, N - 1) << '\n';
	// cout << solve_tab(h, N) << '\n';

	return 0;
}


Measured memory_bytes: 7076
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author ExplodingFreeze
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
#define int long long
#define f(i,a,b) for(int i=(a);i<(b);i++)
#define MOD 1000000007
using pii=std::pair<int,int>;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); <-- PUT IN main()/solve()!

using namespace std;

string s;
class BTapDance {
public:
	void solve(std::istream& in, std::ostream& out) {
		in >> s;
		int possible=1;
		f(i,0,s.length())
			if(((i&1)&&s[i]=='R')||(!(i&1)&&s[i]=='L'))
				possible=0;
		if(possible)
			out << "Yes\n";
		else
			out << "No\n";
	}
};


int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	BTapDance solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include<string.h>
int main()
{
    char s[300000],t[300000];
    int c=0,i,x;
    scanf("%s%s",s,t);
    for(i=0;i<strlen(s);i++)
    {
        if(s[i]!=t[i])
            c++;
    }
    printf("%d\n",c);
}


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


#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repback(i,n) for(int i=(int)n-1;i>=0;i--)
#define repa(i,a,n) for(int i=a;i<(int)(n);i++)
typedef pair<int, int> P;
typedef long long ll;
const ll INF = 1e7, MAX_N = 1000000, MAX_M = 1000, MAX_W = 20, MAX_H = 20;
int asc(const void* a, const void* b) {
    return *(int*)a - *(int*)b;
}

int is_prime[MAX_N]; //i番目の素数
bool prime[MAX_N]; //iが素数であるかどうか

int seive(int n) {
    rep(i, n+1) prime[i] = true;
    prime[0] = prime[1] = false;
    int p = 0;
    repa(i,2,n+1) {
        if (prime[i]) {
            is_prime[p++] = i;
            for (int j = i * 2; j <= n; j += i) prime[j] = false;
        }
    }
    return p;
}
int main() {
    int n;
    while (cin >> n) {
        int ans = seive(n);
        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 4364
#include<iostream>
#include<stdio.h>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
    double n,s[1000]={},ave,sum,b;
    while(1){
        cin>>n;
        if(n==0) break;
        for(int i=0;i<n;i++){
            cin>>s[i];
            sum+=s[i];
        }
        ave=sum/n;
        for(int i=0;i<n;i++) b+=pow(s[i]-ave,2);
        printf("%.8f\n",sqrt(b/n));
        s[1000]={};
        sum=0;
        b=0;
    }
    return 0;
}


Measured memory_bytes: 3284
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int l = sc.nextInt();
		int r = sc.nextInt();
		int d = sc.nextInt();

		sc.close();
		int count = 0;
		for (int i = l; i <= r; i++) {
			if (i % d == 0) {
				count++;
			}
		}

		System.out.println(count);
	}
}


Measured memory_bytes: 26936
#include <iostream>
int main()
{
	int a[4],b[4];
	int A,B;
	A=B=0;
	for(int i=0; i<4; i++)std::cin>>a[i],A+=a[i];
	for(int i=0; i<4; i++)std::cin>>b[i],B+=b[i];
	printf("%d\n",A>B?A:B);
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> P;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

void YN(bool flg){if(flg) cout << "YES" << endl; else cout << "NO" << endl;}
void Yn(bool flg){if(flg) cout << "Yes" << endl; else cout << "No" << endl;}
void yn(bool flg){if(flg) cout << "yes" << endl; else cout << "no" << endl;}

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    cout << c << " " << a << " " << b << endl;
    
    return 0;
}


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

int main(void){
	int N,a[300000];
	cin>>N;
	rep(i,N*3)cin>>a[i];
	sort(a,a+N*3);
	ll sum=0;
	for(int i=N;i<N*3;i+=2) sum+=a[i];
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn=1e6+5;
int main() {
    int n,k;cin>>n>>k;
    vector<ll> tree(n+1);
    const int mod=998244353;
    auto add=[&](int x,ll dx) {
    	for(;x<=n;(tree[x]+=dx)%=mod,x+=x&-x); 
    };
	auto query=[&] (int x) {
		ll ans=0;
		for(;x>0;(ans+=tree[x])%=mod,x-=x&-x);
		return ans;
	};
    std::vector<pii> lr(k+1);
	for(int i=1;i<=k;i++) {
		cin>>lr[i].first>>lr[i].second;
	}
	vector<ll> dp(n+1);dp[1]=1;add(1,1);
	for(int i=2;i<=n;i++) {
		for(int j=1;j<=k;j++) {
			( dp[i]+=(query(i-lr[j].first)-query(i-lr[j].second-1)) )%=mod;
			// cout<<i-lr[j].first<<' '<<i-lr[j].second-1<<endl;
		}
		add(i,dp[i]);
	}
	cout<<(dp[n]+mod)%mod<<endl;
    return 0;
}

Measured memory_bytes: 6372
#include<bits/stdc++.h>
using namespace std;
#define DFS_ITEM 2
int DEPTH;

int ans=0;
int N, M;
int k[100], s[100][100], p[100];
void calc(vector<int> v) {
    vector<int> tmp(10, 0), num;
    bool flag=true;
    
    for(int i=0; i<N; i++){
	if(v[i]==1){
	    num.push_back(i+1);	    
	}
    }
    
    for(int i=0; i<M; i++){
	for(int j=0; j<k[i]; j++){
	    for(int q=0; q<num.size(); q++){
    		if(s[i][j] == num[q]){
    		    tmp[i] += 1;
    		}
    	    }
    	}
	if(tmp[i] %2 != p[i])
	    flag =false;
    }
    
    if(flag){
    	ans++;
	// for(int i=0; i<num.size(); i++){
	//     cout << num[i];
	// }
	// cout << endl;

    }
}

void DFS(int depth, vector<int> v) {    
    if(depth == DEPTH){
	calc(v);
	return;
    }    
    for(int i=0; i<DFS_ITEM; i++){
	v[depth] = i;
	DFS(depth+1, v);	
    }
}


int main(){
    vector<int> v(10, 0);
    cin >> N >> M;    
    for(int i=0; i<M; i++){	
	cin >> k[i];
	for(int j=0; j<k[i]; j++)
	    cin >> s[i][j];
    }


    for(int i=0; i<M; i++){	
	cin >> p[i];
    }
    DEPTH=N;

    DFS(0, v);
    cout << ans << endl;
    
}



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

using namespace std;

int r, D, x;

int main() {

    while (cin >> r >> D >> x) {
        for (int i = 0; i < 10; i++) {
            x = r * x - D;
            cout << x << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 256
n=int(input())
result=0
for i in range(n+1): 
    if i % 3 == 0 and i % 5 == 0:
        result=result    
    elif i % 3 == 0:
        result=result
    elif i % 5 == 0:
        result=result
    else:
        result=result+i
    
print(result)
        

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

void solve(long long N, long long M, std::vector<long long> H, std::vector<long long> A, std::vector<long long> B) {
    map<long long, long long> heightMap;
    for (long long i = 0; i < M; i++) {
        if (heightMap.count(A[i]) == 0) {
            heightMap[A[i]] = H[B[i] - 1];
        } else {
            if (heightMap[A[i]] < H[B[i] - 1]) {
                heightMap[A[i]] = H[B[i] - 1];
            }
        }
        if (heightMap.count(B[i]) == 0) {
            heightMap[B[i]] = H[A[i] - 1];
        } else {
            if (heightMap[B[i]] < H[A[i] - 1]) {
                heightMap[B[i]] = H[A[i] - 1];
            }
        }
    }

    // for (auto i = heightMap.begin(); i != heightMap.end(); i++) {
    //     cout << (*i).first << ": " << (*i).second << endl;
    // }

    long long ans = 0;
    for (long long i = 0; i < N; i++) {
        if (heightMap.count(i + 1) == 0) {
            ans++;
            continue;
        }
        if (heightMap[i + 1] < H[i]) {
            ans++;
            continue;
        }
    }
    cout << ans << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can
// remove this line by using your custom template)
int main() {
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    std::vector<long long> H(N);
    for (int i = 0; i < N; i++) {
        scanf("%lld", &H[i]);
    }
    std::vector<long long> A(M);
    std::vector<long long> B(M);
    for (int i = 0; i < M; i++) {
        scanf("%lld", &A[i]);
        scanf("%lld", &B[i]);
    }
    solve(N, M, std::move(H), std::move(A), std::move(B));
    return 0;
}


Measured memory_bytes: 10932
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
const ll mo = 1000000007;
const ll INF = 1LL << 60; //MAX 9223372036854775807
ll ans = 0;

int main()
{
ll n,k;
cin >> n>>k;
if(k!=1)
cout << n-k << endl;
else cout << 0 << endl;
return 0;
}

Measured memory_bytes: 256