akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define ll long long 
#define FI first 
#define SE second
#define pb push_back 
#define eb emplace_back
#define mod 1000000007
#define all(c) (c).begin(),(c).end()
#define LB  lower_bound
#define UB  upper_bound
#define max3(a,b,c) max(c,max(a,b))
#define min3(a,b,c) min(c,min(a,b))
#define mems(s, n) memset(s, n, sizeof(s))
#define NINF -1e18
#define INF 1e18
#define int ll int
#define OOK order_of_key  //no of elements less than
#define FBO find_by_order //iterator pointing kth element;indexing starts from 0
#define CK3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define CK4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl

typedef pair<int,int> PII;
typedef pair<pair<int,int>,int> PPII;
typedef pair<int,pair<int,int>> PIPI;
typedef map<int,int>MII;
typedef vector<int> VI;
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

/*int power(int a, int b)
{int x=1,y=a;while(b>0){if(b%2){x =(x*y)%mod;}y =(y*y)%mod;b/=2;}return x%mod;}
*/
//int modInverse(int a, int m) {return power(a, m-2);} //gcd(a,m)=1 


signed main()
{
ios::sync_with_stdio(false); cin.tie(0);
int T=1,T1=0;//cin>>T;
while(T1++<T)
{//cout<<"Case #"<<T1<<": ";
 int h,w;
 cin>>h>>w;
 int ar[h][w];vector<pair<PII,PII>>re;int sign=1;
 for(int i=0;i<h;i++)
 for(int j=0;j<w;j++)cin>>ar[i][j];
 int rem=0;
 for(int i=0;i<h;i++)
 {   if(sign==1)
    {
     for(int j=0;j<w;j++)
     {
         if((ar[i][j]+rem)%2==0)rem=0;
         else 
         {
             rem=1;
             if(j==w-1)
             {if(i==h-1);else re.pb({{i,j},{i+1,j}});}
             else
                re.pb({{i,j},{i,j+1}}); 
         }
     }
     sign=0;
    }
    else
    {
        sign=1;
        for(int j=w-1;j>=0;j--)
        {
            if((ar[i][j]+rem)%2==0)rem=0;
         else 
         {
             rem=1;
             if(j==0)
             {if(i==h-1);else re.pb({{i,j},{i+1,j}});}
             else
                re.pb({{i,j},{i,j-1}}); 
         }
        }
    }
 }
 cout<<re.size()<<endl;
 for(auto it:re)
 {
     cout<<it.FI.FI+1<<" "<<it.FI.SE+1<<" "<<it.SE.FI+1<<" "<<it.SE.SE+1<<endl;
 }
    
}


return 0;
}





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

int main() {
  long long n, m;
  cin >> n >> m;
  
  if (n >= m/2) {
    cout << m/2 << endl;
  } else {
    long long i = (m/2 - n)/2;
    cout << n + i << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (((ll)1<<31)-1)
#define eps LDBL_EPSILON
#define moder (1000000007)
#define pie acos(-1)
#define P std::pair<int,int>
#define prique priority_queue
#define ggr getchar();getchar();return 0;
using namespace std;
double a,b;
signed main(){
	cin>>a>>b;
	printf("%.12lf\n",a*b/3.305785);
	return 0;
}


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

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
ll mod = 1e9+7;
void ans(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){fill((T*)array, (T*)(array+N), val);}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

class debug
{
public:
    template<typename T> void vdeb(T vec);
    template<typename T1, typename T2> void adeb(T1 *arr, T2 n);
    template<typename T> void mdeb(T mp);
};

#endif //INCLUDE_DEBUG_HPP

template<typename T> void debug::vdeb(T vec)
{
    cout << "#vector set debug" << endl;
    for(auto vv : vec) cout << vv << " ";
    cout << endl;
}

template<typename T1, typename T2> void debug::adeb(T1 *arr, T2 n)
{
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}

template<typename T> void debug::mdeb(T mp)
{
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
debug dbg;

class APair {
public:
	void solve(std::istream& in, std::ostream& out)
	{
	    int k;
	    in >> k;
	    int even = k / 2;
	    int odd = ceill(k, 2);
	    out << even*odd << endl;
	}
};


int main() {
	APair solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#[allow(dead_code)]
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()
}
#[allow(dead_code)]
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()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn main() {
    let v = read_vec::<u32>();
    let a = v[0];
    let b = v[1];
    if a <= 9 && b <= 9 {
        println!("{}", a * b);
    } else {
        println!("-1");
    }
}


Measured memory_bytes: 4352
#!/usr/local/bin/python3
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n,l = f()
    fsum = sum([ l+i for i in range(n)])

    minabs = min([abs(l+i) for i in range(n)])

    for i in range(n):
        if abs(l+i) == minabs:
            print(fsum - (l+i))
            return

    


solve()


Measured memory_bytes: 3060
#include <iostream>
using namespace std;
 
int main()
{
    int i, n;
    int kane=100000;
     
    cin >> n;
     
    for(i=1; i<=n; i++){
        kane *= 1.05;
        kane = (kane+999) / 1000 * 1000;
    }
    cout << kane << endl;
         
    return 0;
}



Measured memory_bytes: 3040
#include<bits/stdc++.h>
using namespace std;
#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 RREP(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)

int main(){
int d;
int temp=0;
vector<int> c(26);
vector<int> ci(26);
vector<int> rec(26,0);
vector<int>late(27,0);
cin >> d ;
REP(i,26)cin >> c.at(i);

REP1(days,d){
	/*if(days>d-26){
		REP1(i,25)if(c.at(temp)<c.at(i) && rec.at(i)==0){
			rec.at(i)=1;
			temp=i;
			}
		cout << temp+1 << endl;
		//late.at(temp+1)=days;
		temp=0;
		break;
	}*/
	
	REP(i,26)cin >> ci.at(i);
	REP1(i,25)if(ci.at(temp)<ci.at(i))temp=i;
	cout << temp+1 << endl;
	//late.at(temp+1)=days;
	temp=0;
	}
}
	


Measured memory_bytes: 3648
#include <iostream>
#include <cstdlib>
using namespace std;
#define MAX 1000

int A[MAX],top;

void push(int x){
  if(top>=MAX-1){
    cout<<"?????????????????????";
  }
  else{
    top++;
    A[top]=x;
  }
}

int pop(){
  if(top==0){
    cout<<"??¢??????????????????";
    return 0;
  }
  else{
    top--;
    return A[top+1];
  }
}

int main(){
  int a,b;
  int top=0;
  char s[100];
  while(cin>>s){
    if(s[0]=='+'){
      a=pop();
      b=pop();
      push(a+b);
    }
    else if(s[0]=='-'){
      a=pop();
      b=pop();
      push(b-a);
    }
    else if(s[0]=='*'){
      a=pop();
      b=pop();
      push(a*b);
    }
    else push(atoi(s));
  }

  cout<<pop()<<endl;

  return 0;
}
  
  

Measured memory_bytes: 1148
#include <stdio.h>
int main()
{
  int N,i,j,v,l;

  scanf("%d",&N);

  int A[N];

  for(i=0; i<N; i++){
    scanf("%d",&A[i]);
  }
  
  for(i=0; i<N-1; i++){
    printf("%d ",A[i]);
  }
  printf("%d",A[N-1]);
  printf("\n");
  
  for (i=1; i<=N-1; i++){
    v = A[i]; 
    j = i-1; 
    
    while((j>=0)&&(A[j]>v)){
      A[j+1] = A[j]; 
      j--; 
    }
    A[j+1] = v;
    
    for(l=0; l<N-1; l++){
      printf("%d ",A[l]);
    }
    printf("%d",A[N-1]);
    printf("\n");
    
  }
  return 0;
}



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

#define PI 3.14159265359
#define MODULO 1000000007

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int x,y;
	cin >> x >> y;
	int result = y - (x*2);
	string s = "No";
	if( result %2 == 0 && result >= 0){
		 if (result/2 <= x) 
		 	s = "Yes";
	} 
	cout << s;
}

Measured memory_bytes: 3640
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val M, D = sc.nextInt()
  val dayOfProducts = for {
    m <- 1 to M
    d <- (22 to D).filter(2 <= _ % 10)
    if m == (d / 10) * (d % 10)
  } yield ()
  println(dayOfProducts.size)
}


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

class Program
{
    static void Main(string[] args)
    {
        var b = Console.ReadLine();
        var pair = new Dictionary<string, string>(4);
        pair.Add("A", "T");
        pair.Add("C", "G");
        pair.Add("T", "A");
        pair.Add("G", "C");

        Console.WriteLine(pair[b]);
    }
}



Measured memory_bytes: 13152
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))

d = []

for i in range(n):
    temp = t - (h[i] * 0.006)
    d.append(abs(a - temp))

ans = d.index(min(d))+1
print(ans)


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

const int MAXN = 105;

short dp[MAXN][MAXN][MAXN][MAXN], f[MAXN][MAXN], g[MAXN][MAXN], n, m;
char str[MAXN];

inline void update(short &a, short b)
{ a = max(a, b); }

inline short min(int a, short b)
{ return min((short)a, b);}
int main()
{
	cin >> n >> m;
	short x, y;
	for (int i = 1; i <= n; i++) {
		cin >> str+1;
		for (int j = 1; j <= m; j++) {
			if (str[j] == 'E') x = i, y = j;
			else if (str[j] == 'o') f[i][j] = g[j][i] = 1;
		}
	}
	short lenx = max(x-1, n-x), leny = max(y-1, m-y);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= m; j++)
			f[i][j] += f[i][j-1];
	for (int j = 1; j <= m; j++)
		for (int i = 1; i <= n; i++)
			g[j][i] += g[j][i-1];
	short ans = 0;
	for (short i = x; i >= 1; i--)
		for (short j = x; j <= n && j-i <= lenx; j++)
			for (short k = y; k >= 1; k--)
				for (short w = y; w <= m && w-k <= leny; w++) {
					short R = min(m+k-y, w), L = max(k-1, w-y);
					if (L < R) {
						if (i-1 >= 1 && j-i+1 <= x-1)
							update(dp[i-1][j][k][w], dp[i][j][k][w]+f[i-1][R]-f[i-1][L]);
						if (j+1 <= n && j-i+1 <= n-x)
							update(dp[i][j+1][k][w], dp[i][j][k][w]+f[j+1][R]-f[j+1][L]);
					}
					R = min(n+i-x, j), L = max(i-(short)1, j-x);
					if (L < R) {
						if (k-1 >= 1 && w-k+1 <= y-1)
							update(dp[i][j][k-1][w], dp[i][j][k][w]+g[k-1][R]-g[k-1][L]);
						if (w+1 <= m && w-k+1 <= m-y)
							update(dp[i][j][k][w+1], dp[i][j][k][w]+g[w+1][R]-g[w+1][L]);
					}
					ans = max(ans, dp[i][j][k][w]);
				}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 207104
n = int(input())
task = []
for i in range(n):
    a = input().split(" ")
    task.append([int(a[1]), int(a[0])])
task.sort()
time = 0
out = 0
for j in range(n):
    time += task[j][1]
    if time > task[j][0]:
        out = 1
        break
if out == 0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 35604
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	string a;
	while(cin>>n&&n!=0){
		int sum=0;
		int r=0,l=0;
		int f=0;
		for(int i=0;i<n;i++){
			cin>>a;
			if(a=="lu"){
				if(l==0) l++;
			}
			else if(a=="ru"){
				if(r==0) r++;
			}
			else if(a=="ld"&&l==1) l--;
			else if(a=="rd"&&r==1) r--;
			if(r==0&&l==0&&f==1){
				f=0;
				sum++;
			}
			else if(r==1&&l==1&&f==0){
				f=1;
				sum++;
				}
			}
			cout<<sum<<endl;
		}
		}
						

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

using namespace std;

#define all(a) a.begin(), a.end()
#define pi acos(-1)
#define eps 1e-6
#define inf 1e14

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;

const int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dy[8] = {-1, 0, 1, -1, 1, 0, 1, -1};
const int maxn = 3005;
const int mod = 1e9 + 7;
const int maxa = 2 * 1e5;

int mul(int a, int b) { return a * 1LL * b % mod;}
int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b;}
int sub(int a, int b) { return a >= b ? a - b : a - b + mod;}
int pow(int a, int k)
{
    int res = 1;
    while (k)
    {
        if (k % 2) res = mul(res, a);
        a = mul(a, a);
        k /= 2;
    }

    return res;
}

int inv(int a)
{
    return pow(a, mod - 2);
}

string a, b;
int n, m;

typedef pair<int, pair<int, int> > prevs;

prevs dp[maxn][maxn];
prevs maxs(prevs &a, prevs b)
{
    return a = max(a, b);
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> a >> b;
    n = a.size();
    m = b.size();
    for (int i = 0; i <= n; ++i)
        for (int j = 0; j <= n; ++j)
            dp[i][j] = {-1e9, {0, 0}};

    dp[0][0] = {0, {0, 0}};
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < m; ++j)
        {
            if (a[i] == b[j])
                maxs(dp[i + 1][j + 1], {dp[i][j].first + 1, {i, j}});

            maxs(dp[i + 1][j], {dp[i][j].first, {i, j}});
            maxs(dp[i][j + 1], {dp[i][j].first, {i, j}});
        }
    }

    
    prevs best = {0, {0, 0}};
    for (int i  = 0; i <= n; ++i)
        for (int j = 0; j <= m; ++j)
            maxs(best, {dp[i][j].first, {i, j}});
    
    ii curr = best.second;
    string res;
    while (curr.first && curr.second)
    {
        int i = curr.first, j = curr.second;
        ii prev = dp[i][j].second;
        if (prev == ii(i - 1, j - 1))
            res = a[i - 1] + res;

        curr = prev;
    }

    cout << res;
}


Measured memory_bytes: 105984
import java.util.Scanner;

public class Main {

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

        int r = sc.nextInt();
        int g = sc.nextInt();
        int b = sc.nextInt();

        System.out.println((r*100+g*10+b) % 4 == 0 ? "YES" : "NO");
    }
}


Measured memory_bytes: 23892
using System;

namespace Prime_Number
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string input = Console.ReadLine();
                if (input == null)
                {
                    break;
                }
                int n = int.Parse(input);
                int count = 0;
                if (n == 1)
                {
                    Console.WriteLine(0);
                }
                else if (n == 2)
                {
                    Console.WriteLine(1);
                }
                else
                {
                    if (n % 2 == 0)
                    {
                        n = n - 1;
                    }
                    for (int i = 3; i <= n; i+=2)
                    {
                        for (int j = 3; j*j <= i; j+=2)
                        {
                            if (i % j == 0)
                            {
                                ++count;
                                break;
                            }
                            
                        }
                        
                    }
                    Console.WriteLine(n/2 - count + 1);

                    
                }

            }
        }
    }
}



Measured memory_bytes: 15976
#include <iostream>
using namespace std;
int a[1000010];
int main() {
	int X; cin >> X;
	a[1]=X;
	int ans;
	for(ans=2; true; ++ans){
		if(a[ans-1]%2) a[ans]=a[ans-1]*3+1;
		else a[ans]=a[ans-1]/2;
		if(ans>3){
			if(a[ans-3]==a[ans]) break;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "YES" << endl
#define pyes cout << "Yes" << endl
#define POK cout << "OK" << endl
#define PNO cout << "NO" << endl
#define pno cout << "No" << endl
#define PNG cout << "NG" << endl
#define ret return 0

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>
//  ba;
signed main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<ll> a(n + 1, 1);
  vector<bool> isvisit(n + 1, false);
  for (ll i = 2; i <= n; i++) {
    if (isvisit[i]) continue;
    for (ll j = i; j <= n; j *= i) {
      isvisit[j] = true;
      for (ll k = j; k <= n; k += j) {
        a[k]++;
      }
    }
  }
  ll res = 0;
  repz(i, 1, n + 1) { res += a[i] * i; }
  cout << res << endl;
  ret;
}


Measured memory_bytes: 82628
n, m = map(int, input().split())

mod = 10**9 + 7
l = n+m
ans = 1
b = max(n, m)
s = min(n, m)
for i in range(l):
    if i % 2 == 0:
        tmp = b-i//2
        if tmp > 0:
            ans = (ans % mod) * (tmp % mod)
        else:
            print(0)
            exit()
    else:
        tmp = s-i//2
        if tmp > 0:
            ans = (ans % mod) * (tmp % mod)
        else:
            print(0)
            exit()
if l%2 == 0:    
    ans = (ans % mod) * (2 % mod)
print(ans%mod)


Measured memory_bytes: 9144
n = int(input())
a = []
b = []
c = []
for i in range(n):
    a_,b_,c_ = map(int,input().split())
    a.append(a_)
    b.append(b_)
    c.append(c_)
dp = [[0]*3 for i in range(n+1)]
dp[0][0] = a[0]
dp[0][1] = b[0]
dp[0][2] = c[0]

for i in range(1,n):
    for j in range(3):
        if j == 0:
           dp[i][j] = max(a[i]+dp[i-1][1],a[i]+dp[i-1][2]) 
        elif j == 1:
           dp[i][j] = max(b[i]+dp[i-1][0],b[i]+dp[i-1][2]) 
        elif j == 2:
           dp[i][j] = max(c[i]+dp[i-1][1],c[i]+dp[i-1][0]) 
            
print(max(dp[n-1][j] for j in range(3)))

Measured memory_bytes: 40308
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

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

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n, a, b;
    lint ans = 0;
    cin >> n >> a >> b;
    for (int i=1; i<=n; ++i){
        int dig_sum = 0;
        int m = i;
        while(m > 0){
            dig_sum += m % 10;
            m /= 10;
        }
        if(a <= dig_sum && dig_sum <= b){
            ans += i;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import heapq
from collections import defaultdict
 
dc = defaultdict(list)
n,m = map(int,input().split())
for i in range(n):
    a,b = map(int,input().split())
    dc[a].append(b)

ans = 0
cands = []
for i in range(1,m+1):
    for j in dc[i]:
        heapq.heappush(cands, -j)
    if len(cands) > 0:
        ans += heapq.heappop(cands)*(-1)
    # print("---",cands)

print(ans)

Measured memory_bytes: 27800
import java.util.*;
public class Main{
  public static void main(String []args){
  Scanner sc = new Scanner(System.in);

  int n = sc.nextInt();

  int[] t = new int[n];
  int[] x = new int[n];
  int[] y = new int[n];
  int[] data = new int[n];

  for (int i = 0;i<n ;i++ ) {
    t[i] = sc.nextInt();
    x[i] = sc.nextInt();
    y[i] = sc.nextInt();
    data[i] = x[i]+y[i];
  }

  for (int i = 0;i<n ;i++ ) {
    if ((t[i]%2==0&&data[i]%2==1)||(t[i]%2==1&&data[i]%2==0)) {
      System.out.println("No");
      System.exit(0);
    }
    if (t[i]<x[i]+y[i]) {
      System.out.println("No");
      System.exit(0);
    }
  }
  System.out.println("Yes");


  }
}


Measured memory_bytes: 92680
#include<bits/stdc++.h>
 
#define ll long long 
# define skorost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) 

using namespace std ;
 
ll z , o , ans ;

ll N = 1e4 + 15820 ;

int main(){ skorost ;

	int n , k , x , y ;

	cin >> n >> k >> x >> y ;

	if( n <= k ){

		cout << n * x << endl ;

	}

	else{

		cout << ( k * x ) + ( ( n - k ) * y ) << endl ;

	}

}

Measured memory_bytes: 256
import sys
from collections import deque, defaultdict
from itertools import combinations, permutations
from heapq import heapify, heappop, heappush

def solve():
    input = sys.stdin.readline
    N, D, A = map(int, input().split())
    M = [tuple(int(m) for m in input().split()) for _ in range(N)]
    M.sort()
    #print(M)
    HP = [0] * (N + 2)
    count = 0
    for i, m in enumerate(M):
        HP[i + 1] += HP[i]
        #print(HP)
        x, h = m
        right = x + 2 * D
        if HP[i + 1] < h:
            add = (h - HP[i + 1]) // A
            if (h - HP[i + 1]) % A > 0: add += 1
            small, large = i, N
            while large - small > 1:
                mid = (small + large) // 2
                if M[mid][0] > right: large = mid
                else: small = mid
            HP[i + 1] += add * A
            HP[small + 2] -= add * A
            count += add
    #print(HP)
    print(count)

    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 38348
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int
#define ulli unsigned long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(lli i=a;i<b;i++)
#define initialize(array,size,value) for(lli i=0;i<size;i++) array[i]=value
#define couta(array,size) for(lli i=0;i<size;i++) cout<<array[i]<<" "
#define vl vector<lli>
#define vp vector< pair <lli,lli> >
#define sl set<lli>
#define msp multiset < pair < long long , long long > > S;
#define pll pair<lli, lli>
#define mll map<lli, lli>            //for( map<lli, lli>::iterator i=temp.begin();i!=temp.end();i++)cout<<i->fi<<" "<<i->se<<endl;
#define mvl map<lli, vl>
#define umll unordered_map<lli, lli>
#define vt vector<pair<lli, pll >  >
#define vf vector<pair<pll,pll > >
#define qu queue<lli>
#define pq priority_queue<lli>
#define dq deque <lli>
#define ptr vector<lli>::iterator
#define bs(array,x) binary_search(array.begin(),array.end(),x) // also valid for set and multiset
#define lb(array,x) lower_bound(array.begin(),array.end(),x)
#define ub(array,x) upper_bound(array.begin(),array.end(),x)
#define nobw(array,i,j) upper_bound(array.begin(), array.end(), j)-lower_bound(array.begin(), array.end(), i) //number of numbers between i & j
#define vc clear()
#define endl '\n'
#define sp system("pause");
#define INF 9223372036854775807
#define MINF -9223372036854775808
typedef tree<pll,null_type,less<pll>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
//string binary = bitset<32>(n).to_string(); 
int main()
{
	ios::sync_with_stdio(0);
    cin.tie(0);
  	lli n,l;
   	cin>>n>>l;
   	lli a[n];
   	for(lli i=0;i<n;i++)a[i]=l+i;
   	lli j=0,ani=abs(a[0]);
    for(lli i=0;i<n;i++){
    	if(abs(a[i])<ani){
    		ani=abs(a[i]);
    		j=i;
    	}
    }
    lli ans=0;
    for(lli i=0;i<n;i++)
    	if(i!=j)ans+=a[i];
    cout<<ans;
 








    return 0;
} 


Measured memory_bytes: 256
from collections import deque

def comb(s):
    p = deque([('','')])

    for i in range(len(s)):
        for j in range(2**i):
            e = p.pop()
            p.appendleft((e[0]+s[i],e[1]))
            p.appendleft((e[0],e[1]+s[i]))
    return p

n = int(input())
s = input()

sl = s[0:n]
sr = s[n:2*n][::-1]
keys1 = [c[0]+'-'+c[1] for c in comb(sl)]
keys2 = [c[0]+'-'+c[1] for c in comb(sr)]

dict = {}
for key1 in keys1:
    if key1 in dict:
        dict[key1] += 1
    else:
        dict[key1] = 1
cnt = 0
for key2 in keys2:
    if key2 in dict:
        cnt += dict[key2]

print(cnt)

 


Measured memory_bytes: 96108
N = int(input())
S = input()

opposite = {"S": "W",
            "W": "S"}

for ans in ["SS","SW","WS","WW"]:
  for i in range(1,N-1):
    if (ans[i],S[i]) in [("S","o"),("W","x")]:
      ans += ans[i-1]
    elif (ans[i],S[i]) in [("S","x"),("W","o")]:
      ans += opposite[ans[i-1]]
  
  for i in [-1,0]:
    if ans[i] == "S":
      if (S[i] == "o" and ans[i-1] != ans[i+1]) or (S[i] == "x" and ans[i-1] == ans[i+1]):
        break
    else:
      if (S[i] == "o" and ans[i-1] == ans[i+1]) or (S[i] == "x" and ans[i-1] != ans[i+1]):
        break
  else:
    print(ans)
    break
else:
  print(-1)

Measured memory_bytes: 3444
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
long long a,b;
int main(){
	cin>>a>>b;
	if(a==0||b==0){
           cout<<"Zero"<<endl;
           return 0;
	}
        if(a==b){
           cout<<"Positive"<<endl;
        }
        if(a<=0&&0<=b){
           cout<<"Zero"<<endl;
           return 0;
        }
        if(0<a){
           cout<<"Positive"<<endl;
           return 0;
        }
        if(b<=0){
           if((a-b)%2==0){
               cout<<"Negative"<<endl;
           }else{
               cout<<"Positive"<<endl;
           }
        }
	return(0);
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {

            var N = cin.ReadLong;
            long[] D = cin.ReadLongArray(N);
            Array.Sort(D);
            long A = D[(N / 2)-1];
            long B = D[N / 2];
            if (A == B)
            {
                Console.WriteLine(0);
            }
            else
            {
                long count = 0;
                for(long i = A+1; i <= B; i++)
                {
                    count++;
                }
                Console.WriteLine(count);
;            }
            
            
        }



    }
    

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
        public double[] ReadDoubleArray(long N) { var ret = new double[N]; for (long i = 0; i < N; ++i) ret[i] = ReadDouble; return ret; }
    }
}

Measured memory_bytes: 21216
#include <bits/stdc++.h>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

int main() {
    int64_t n, k;
    cin >> n >> k;

    int64_t r, s, p;
    cin >> r >> s >> p;

    string t;
    cin >> t;

    int64_t ans = 0;
    unordered_map<char, int64_t> m;
    m['r'] = p;
    m['s'] = r;
    m['p'] = s;
    for (auto i : irange(0L, k)) {
        char prev = 0;
        for (int64_t j = i; j < n; j += k) {
            if (prev != t[j]) {
                ans += m[t[j]];
                prev = t[j];
            } else {
                prev = 0;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 512
#■標準入力ショートカット


def get_next_int():
    return int(float(input()))


def get_next_ints(delim=" "):
    return tuple([int(float(x)) for x in input().split(delim)])


def get_next_str():
    return input()


def get_next_strs(delim=" "):
    return tuple(input().split(delim))


def get_next_by_types(*value_types, delim=" "):
    return tuple([t(x) for t, x in zip(value_types, input().split(delim))])


A, B, X = get_next_ints()


if A <= X and A+B >= X:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3064
N = int(input())
C = [list(map(str,input().split())) for _ in range(N)]

l = [0]*4

for c in C:
  if c == ["AC"]:
    l[0] += 1
  elif c == ["WA"]:
    l[1] += 1
  elif c == ["TLE"]:
    l[2] += 1
  else:
    l[3] += 1

print("AC x "+str(l[0]))
print("WA x "+str(l[1]))
print("TLE x "+str(l[2]))
print("RE x "+str(l[3]))

Measured memory_bytes: 25636
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int x,y;
  cin >> x >> y;
  cout << x+y/2 << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
                                                                                                
  
int main(){
                                                                                                
   
    int a, b, i;

    string s;

         
    cin >> a >> b >> s;


    for( i = 0 ; i < s.size() ; i = i + 1 ){

         if( i != a && s.at(i) == '-' ){

             cout << "No" << endl;

             return 0;

             }

         if( i == a && s.at(i) != '-' ){

             cout << "No" << endl;

             return 0;

             }

          }


    cout << "Yes" << endl;


    return 0;
                                                          
}

Measured memory_bytes: 256
import java.io.*
import java.util.*

fun solve(N: Int, A: IntArray){
    val diffs = A.mapIndexed{ idx, it -> it - idx - 1 }.sorted()
    val b1 = N/2
    val ans = diffs.map{ Math.abs(it - diffs[b1]).toLong() }.sum()
    println(ans)
    return
}


fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val N = sc.next().toInt()
    val A = IntArray(N)
    for (i in 0 until N) {
        A[i] = sc.next().toInt()
    }
    solve(N, A)
}



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

int sumOfDigits(int n){
  if (n==0) return 0;
  return n%10 + sumOfDigits(n/10);
}

int main(){
  int n;
  cin >> n;
  int ans = 200000;
  for (int i = 1; i <= n/2; i++) {
    int flg = sumOfDigits(i)+sumOfDigits(n-i);
    if (ans > flg) ans = flg;
  }
  cout << ans;
}


Measured memory_bytes: 256
/*   _/                _/                 _/_/_/   _/
  _/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
   _/     _/    _/   _/     _/    _/  _/_/_/     _/
  _/     _/    _/   _/     _/    _/  _/    _/   _/
   _/_/   _/_/       _/_/   _/_/      _/_/     _/ */
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
using ll=long long;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=1e18;
using P=pair<int,int>;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n,a[105]={},ans=inf,cnt=0;
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> a[i];
  }
  for(int i=-100; i<=100; i++) {
    cnt=0;
    for(int j=0; j<n; j++) {
      cnt+=pow(i-a[j],2);
    }
    ans=min(ans,cnt);
  }
  cout << ans << endl;
}

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

using namespace std;

int h, w, n;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> h >> w >> n;
    cout << (n + max(h, w) - 1) / max(h, w) << endl;
    return 0;
}


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

using namespace std;

int DpLen[4000][4000];

int main() {
	int sLen, tLen, maxLen;
	string s, t;

	while (cin >> s >> t) {
		memset(DpLen, 0, sizeof(DpLen));
		sLen = s.size();
		tLen = t.size();
		maxLen = 0;
		for (int i = 0; i < sLen; ++i) {
			for (int j = 0; j < tLen; ++j) {
				if (s[i] != t[j]) {
					continue;
				}
				if (i == 0 || j == 0) {
					DpLen[i][j] = 1;
				}
				else {
					DpLen[i][j] = DpLen[i - 1][j - 1] + 1;
				}
				maxLen = max(maxLen, DpLen[i][j]);
			}
		}
		cout << maxLen << endl;
	}

	return 0;
}


Measured memory_bytes: 65708
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int main() {
  int q;
  while (scanf("%d", &q) > 0) {
    ll cnt = 0;
    while (q--) {
      char c;
      int v;
      scanf("%*d %c %d", &c, &v);
      cnt += c == ')' ? v : -v;
      puts(cnt == 0 ? "Yes" : "No");
    }
  }
}

Measured memory_bytes: 0
#ifdef _WIN32
#include "stdc++.h"
#else
#include <bits/stdc++.h>
#endif

// 継承可能な型
template <class Type>
struct IN : Type
{
	IN()
	{
		std::cin >> *this;
	}
};

// 継承不可能な型
template <class Type>
struct IN_
{
	Type val;

	IN_()
	{
		std::cin >> val;
	}

	operator Type&()
	{
		return val;
	}

	IN_<Type>& operator=(const Type& _value)
	{
		val = _value;
		return *this;
	}
};

template <class Char, class Type>
std::basic_ostream<Char>& operator <<(std::basic_ostream<Char>& os, const IN_<Type>& value)
{
	return os << value.val;
}

template <class Char, class Type>
std::basic_istream<Char>& operator >>(std::basic_istream<Char>& is, IN_<Type>& value)
{
	return is >> value.val;
}

template <class Type>
void OUT(const Type& value)
{
	std::cout << value << std::endl;
}

template <class Type, class ... Args>
void OUT(const Type& value, const Args& ... args)
{
	std::cout << value << ' ';
	OUT(args...);
}

using ll = long long;
using inll = IN_<ll>;
using vll = std::vector<ll>;
using setll = std::set<ll>;
using msetll = std::multiset<ll>;
using instr = IN<std::string>;

#define FOR(i, m, n) for (ll (i) = (m); (i) < (n); ++(i))
#define REP(i, n) for (ll (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (ll (i) = (n); (i) >= 0; --(i))
#define ITRREP(it, v) for (auto (it) = (v).begin(); (it) != (v).end(); ++(it))
#define ITRREPR(it, v) for (auto (it) = (v).rbegin(); (it) != (v).rend(); ++(it))
#define DIVUP(a, b) (((a) + (b) - 1) / (b))

void Main();

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

	Main();

#ifdef _DEBUG
	system("pause");
#endif

	return 0;
}

using namespace std;

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

void Main()
{
	inll n;
	vll t, x, y;
	t.push_back(0);
	x.push_back(0);
	y.push_back(0);

	REP(i, n)
	{
		inll t_, x_, y_;
		t.push_back(t_);
		x.push_back(x_);
		y.push_back(y_);
	}

	REP(i, n)
	{
		ll dist = x[i + 1] - x[i] + y[i + 1] - y[i];
		ll time = t[i + 1] - t[i];

		if (dist > time)
			return OUT("No");

		if ((dist - time) % 2 != 0)
			return OUT("No");
	}

	OUT("Yes");
}


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

long long a, b, c[55], n, m;
int main(){
	cin >> n >> m;
	for (int i = 1; i <= m; i++){
		cin >> a >> b;
		c[a]++; c[b]++;
	}
	for (int i = 1; i <= n; i++){
		cout << c[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 256
<?php
 
fscanf(STDIN, '%s', $number);
$numbers = str_split($number);
for ($i = 0; $i < count($numbers); $i++) {
	$numbers[$i] = (int)$numbers[$i];
}
 
function sum($_numbers, $_cur = 0) {
    if (count($_numbers) === 0) {
    	return $_cur;
    } else if (count($_numbers) === 1) {
    	return $_cur + $_numbers[0];
    }
    $sum = 0;
    $cur = 0;
    for ($i = 0; $i < count($_numbers); $i++) {
        $cur = $cur * 10 + $_numbers[$i];
        $sum += sum(array_slice($_numbers, $i + 1), $_cur + $cur);
    }
    return $sum;
}
 
echo sum($numbers).PHP_EOL;

Measured memory_bytes: 3960
import * as fs from 'fs'

const input = (fs.readFileSync('/dev/stdin', 'utf8') as string).split('\n')
const x = +input[0]

let i = 1
let sum = 100

while (true) {
  sum += Math.floor(sum * 0.01)
  if (x <= sum) {
    break
  }
  i++
}

console.log(i)


Measured memory_bytes: 29660
#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  int k;
  cin >> k;
  int ans = 1;
  for (int i = 0;i<n;i++){
    if (ans < k){
      ans *= 2;
    }
    else{
      ans += k;
    }
  }
  cout << ans << endl;
}


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

typedef long long ll;

#define REP(i, N) for (int i = 0; i < (int)(N); i++)

// chmax, chmin
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using Pint = pair<int,int>;

int main() {
    int N;
    cin >> N;
    
    vector<Pint> r(N),b(N);
    REP(i,N){
        int a,b;
        cin >> a >> b;
        r[i] = Pint(-b,-a);
    }
    REP(i,N){
        int c,d;
        cin >> c >> d;
        b[i] = Pint(c,d);
    }
    
    sort(r.begin(),r.end());
    sort(b.begin(),b.end());
    
    vector<bool> used(N,false);
    
    int ans = 0;
    REP(i,N) REP(j,N){
        Pint blue = b[i];
        Pint red = r[j];
        int bx = blue.first, by = blue.second;
        int rx = -red.second, ry = -red.first;
        if ( !used[j] and rx < bx and ry < by ){
            used[j] = true;
            ++ ans;
            break;
        }
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 3584
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)

N,D = ilint()
M,T = ilint()
S = dict()
for d in D:
    S.setdefault(d,0)
    S[d] += 1
for t in T:
    if t not in S or S[t]==0:
        print('NO')
        exit()
    S[t] -= 1
print('YES')

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

using namespace std;
typedef long long ll;

#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(a) (a).begin(), (a).end()

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

    cout << (a + b + 1) / 2 << '\n';

    return 0;
}


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

int main(){
    int a,b;    cin >> a >> b;
    int i = 1;
    for(; i < 10000; i++){
        if(i*8/100 == a && i/10 == b){
            cout << i << endl;
            break;
        }
    }
    if(i >= 10000){
        cout << -1 << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007LL;
const int INF = LLONG_MAX;
int dp[210][210][210] = {};

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

    // 上から i 番目までみて、左は j 個、右は k 個余ってる時の通り数
    dp[0][0][0] = 1;

    // - は無視
    vector<char> v;
    for(int i = 0; i < n; i++){
        char c; cin >> c;
        if(c == '-') continue;
        v.push_back(c);
    }

    // マッチングの問題に帰着

    n = (int)v.size();

    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            for(int k = 0; k < n; k++){
                if(dp[i][j][k] == 0) continue;

                if(v[i] == 'D'){
                    // 右は j 個のうち一つと必ず結ぶ

                    int mul = 1;
                    // 左をどこかと結ぶ
                    mul *= j;
                    mul %= MOD;
                    mul *= k;
                    mul %= MOD;
                    dp[i + 1][j - 1][k - 1] += dp[i][j][k] * mul;
                    dp[i + 1][j - 1][k - 1] %= MOD;

                    // 左を保留にする
                    mul = 1;
                    mul *= j;
                    mul %= MOD;
                    dp[i + 1][j][k] += dp[i][j][k] * mul;
                    dp[i + 1][j][k] %= MOD;

                }else{

                    // 右は保留確定

                    int mul = 1;
                    // 左をどこかと結ぶ
                    mul *= k;
                    mul %= MOD;
                    dp[i + 1][j][k] += dp[i][j][k] * mul;
                    dp[i + 1][j][k] %= MOD;

                    // 左を保留にする
                    dp[i + 1][j + 1][k + 1] += dp[i][j][k];
                    dp[i + 1][j + 1][k + 1] %= MOD;
                }
            }
        }
    }

    cout << dp[n][0][0] << endl;
    return 0;
}


Measured memory_bytes: 20812
#include <bits/stdc++.h>
    using namespace std;
     
    int main(){
        long long ans = 0;
        string s;
        cin >> s;
        vector <char> v;
        for(int i = 0; i < (int)s.size(); i++){
            if(s[i] == 'B' && s[i+1] == 'C' && i + 1 < s.size()){
                v.push_back('D');
                i++;
                continue;
            }
            if(s[i]!='A'){
               s[i] = 'Z';
            }
            v.push_back(s[i]);
            
        }
        //for(int i =0; i < v.size(); i++){cout << v[i];}
        int size = (int)v.size();
        for(int i = 0; i < size; i++){
            if(v[i]=='Z'){
                int last = i-1;
                int j = i-1;
                while(v[j]!='Z' && j >= 0){
                    if(v[j]=='A'){
                        ans += last-j;
                        //cout << last << " " << j << '\n';
                        last--;
                    }
                    j--;
                }
                //cout << ans << '\n';
            }
            if(i==size-1 && v[i]!='Z'){
                int last = i;
                int j = i;
                while(v[j]!='Z' && j >= 0){
                    if(v[j]=='A'){
                        ans += last-j;
                        //cout << last << " " << j << '\n';
                        last--;
                    }
                    j--;
                }
            }
        }
        cout << ans << '\n';
    }

Measured memory_bytes: 772