akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
class Main{
    int max(int a,int b){
	if(a<b)return b;
	else return a;
    }
    int min (int a,int b){
	if(a>b)return b;
	else return a;
    }
    Main(){
	Scanner sc =new Scanner(System.in);
	int a,c,d;
	a=sc.nextInt();
	d=-1000000000;
	c=sc.nextInt();
	for(int i=0;i<a-1;i++){
	    int f=sc.nextInt();
	    d=max(d,f-c);
	    c=min(c,f);
	}
	System.out.println(d);
    }
    public static void main (String[]arg){
	new Main();
    }
}

Measured memory_bytes: 94336
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
#define int long
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
const int INF = 1e9;
using namespace std;

signed main() {
    ll A[3]; rep(i,3) cin >> A[i];
    bool can = false;
    rep(i,3) if(A[i]%2==0){can = true; break;}
    if(can){
        cout << 0 << endl;
    } else {
        sort(A,A+3);
        cout << A[0]*A[1] << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
#include <stdio.h>
#include <map>
#include <random>
#include <string>
#include<vector>
#include<stack>
#include <cstdlib>


using namespace std;

int main() {
	int k, a, b;
	int tmp1, tmp2;
	cin >> k >> a >> b;
	tmp1 = (b / k) * k;
	if (a<=tmp1) {
		cout << "OK";
	}
	else {
		cout << "NG";
	}


	return 0;
}

Measured memory_bytes: 3084
using System;
using System.Collections.Generic;
 
namespace agc005_a
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            Stack<char> stack = new Stack<char>();
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == 'S')
                {
                    stack.Push('S');
                }
                else
                {
                    if (stack.Count == 0)
                    {
                        stack.Push('T');
                    }
                    else
                    {
                        if (stack.Peek() == 'S')
                        {
                            stack.Pop();
                        }
                        else
                        {
                            stack.Push('T');
                        }
                    }
                }
            }
            Console.WriteLine(stack.Count);
        }
    }
}

Measured memory_bytes: 13268
n = int(input())
s = list(map(int, input().strip().split(' ')))
e = int()
e = 0
flag = True
while flag:
        flag = False
        for i in range(n - 1, 0, -1):
            if s[i] < s[i - 1]:
                s[i - 1], s[i] = s[i], s[i - 1]
                e = e + 1
                flag = True

for i in range(0 , len(s)):
    if i != len(s) - 1:
        print(s[i], end=" ")
    else:
        print(s[i])

print(e)



Measured memory_bytes: 5612
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "cmath"
#include "random"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;


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

	vector<long double>edge;
	vector<long double >x(3);
	vector<long double >y(3);
	for (int i = 0; i < 3; i++) {
		cin >> x[i] >> y[i];
	}
	for (int i = 0; i < 3; i++) {
		for (int j = i + 1; j < 3; j++) {
			edge.push_back(sqrt(abs(x[i] - x[j])*abs(x[i] - x[j]) + abs(y[i] - y[j])*abs(y[i] - y[j])));
		}
	}
	sort(edge.begin(), edge.end());
	x[0] = 0;
	y[0] = 0;
	x[1] = edge[2];
	y[1] = 0;
	x[2] = (edge[1] * edge[1] + edge[2] * edge[2] - edge[0] * edge[0]) / (edge[2] * 2);
	y[2] = sqrt(edge[1] * edge[1] - x[2] * x[2]);
	long double l = 0;
	long double r = 1000;
	for (int i = 0; i < 200; i++) {
		long double mid = (l + r) / 2;
		if (mid * 2 >= y[2]) {
			r = mid;
			continue;
		}
		long double w = x[1] * (y[2] - mid) / y[2];
		w -= mid*edge[1] / y[2];
		w -= mid*edge[0] / y[2];
		if (w >= mid * 2) {
			l = mid;
		}
		else {
			r = mid;
		}
	}
	cout << setprecision(15) << l << endl;
	return 0;
}


Measured memory_bytes: 256
// Problem : B - Easy Linear Programming
// Contest : AtCoder - AtCoder Beginner Contest 167
// URL : https://atcoder.jp/contests/abc167/tasks/abc167_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
#include<set>
#include<map>
#include<bitset>
#define rep(i,a,b)  for(i=a;i<b;i++)
#define itrep(at)	for(auto it=at.begin();it!=at.end();it++)
#define lli long long int
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define db double
#define M 1000000007
#define pi 3.1415926535897932384626433832795028841971
#define INF 1e18

#define MAX 200005

using namespace std;
lli min(lli a,lli b){return a<b?a:b;}
lli min(lli a,lli b,lli c){a=min(a,b);a=min(a,c);return a;}
lli max(lli a,lli b){return a>b?a:b;}
lli max(lli a,lli b,lli c){a=max(a,b);a=max(a,c);return a;}
lli dsum(lli n){lli ans=0;while(n){ans+=(n%10);n/=10;}return ans;}
lli power(lli a,lli b){lli res=1;while(b){if(b&1) res=res*a;a=a*a;b>>=1;}return res;}

struct pll{
	lli x,y;
};
bool comp(pll a,pll b){
	if(a.x==b.x)	return a.y<b.y;
	else	return a.x<b.x;
}
void solve(lli the)
{
	char ch;
	db aa,bb,cc,dd,xx;
	string s1,s2,s3,str;
    lli i,j,k,a,b,c,d,n,m,l,r,x,y,z,low,high,mid,sum=0,ans=0,temp,t;
    cin >> a >> b >> c >> k;
    d=min(a,k);sum+=d;
    k-=d;
    if(k<=0){cout<<sum;return;}
    k-=b;
    if(k<=0){cout<<sum;return;}
    sum-=k;cout<<sum;
    
    
}













int main()
{
	long long int t=1,c=1;
	//scanf("%lld",&t);
	while(t--){
		solve(c);
		c++;
	}
	return 0;
}
/* UJJWAL KESHRI */

Measured memory_bytes: 3628
H, W, N = map(int, input().split())
D = {}
V = [-1, 0, 1]
ans = [0]*10
ans[0] = (H-2)*(W-2)
for i in range(N):
    a, b = map(int, input().split())
    for da in V:
        if not 2 <= a + da <= H-1:
            continue
        na = a + da
        for db in V:
            if not 2 <= b + db <= W-1:
                continue
            nb = b + db
            cnt = D[na, nb] = D.get((na, nb), 0) + 1
            ans[cnt-1] -= 1
            ans[cnt] += 1
print(*ans, sep='\n')

Measured memory_bytes: 151700
/*
 *  Created on: 19 / 9 / 2020
 *  Author:     Eslam Waheed
 */

#define _CRT_SECURE_NO_WARNINGS
//#define __USE_MINGW_ANSI_STDIO

#include<bits/stdc++.h>
//#include <bits/BIGINT.h>
//#include <bits/Int128.h>
using namespace std;

#define Eslam__Waheed ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);

#define ll   long long
#define ull  unsigned ll
#define ld   long double

#define all(c)  c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define stp(n)  cout << fixed << setprecision(n);
#define iq(v)   v.resize(unique(v.begin(),v.end())-v.begin())
#define sz(s)   s.size()
#define endl    '\n'

//ll gcd(ll a, ll b) { return !b ? abs(a) : gcd(b, a % b); }
//ll lcm(ll a, ll b) { return abs(a / gcd(a, b)) * b; }

//const ld PI = acos(-1);
//const ll mod = 1e9 + 7;
//const ld EPS = 1e-8;
/*
 you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )
*/
int main()
{
    //stp(0)
    Eslam__Waheed;
    string s; cin >> s;
    if (s.back() == 's')
        cout << s << "es";
    else
        cout << s << 's';
}


Measured memory_bytes: 3680
n = int(input())
h = list(map(int,input().split()))
h[0] -= 1
for i in range(1,n):
    if h[i] > h[i - 1]:
        h[i] -= 1
    elif h[i] < h[i - 1]:
        print("No")
        break
else:
    print("Yes")

Measured memory_bytes: 20632
package main
import "fmt"
func main() {
  var n,t int
  var d,c [][]int
  fmt.Scan(&n,&t)
  d = make([][]int,t)
  for i:=0;i<t;i++ {
    d[i] = make([]int,t)
    for j:=0;j<t;j++ {
      fmt.Scan(&d[i][j])
    }
  }
  c = make([][]int,n)
  for i:=0;i<n;i++ {
    c[i] = make([]int,n)
    for j:=0;j<n;j++ {
      fmt.Scan(&c[i][j])
      c[i][j]--
    }
  }
  m0 := map[int]int{}
  m1 := map[int]int{}
  m2 := map[int]int{}
  for i:=0;i<n;i++ {
    for j:=0;j<n;j++ {
      switch (i+j)%3 {
      case 0:
        m0[c[i][j]]++
      case 1:
        m1[c[i][j]]++
      case 2:
        m2[c[i][j]]++
      }
    }
  }
  d0 := Entries{}
  d1 := Entries{}
  d2 := Entries{}
  for i:=0;i<t;i++ {
    var x int
    for k,v := range m0 {
      x += d[k][i]*v
    }
    d0 = append(d0,Entry{i,x})
  }
  for i:=0;i<t;i++ {
    var x int
    for k,v := range m1 {
      x += d[k][i]*v
    }
    d1 = append(d1,Entry{i,x})
  }
  for i:=0;i<t;i++ {
    var x int
    for k,v := range m2 {
      x += d[k][i]*v
    }
    d2 = append(d2,Entry{i,x})
  }
  var m int = 2000000000
  for i:=0;i<t;i++ {
    for j:=0;j<t;j++ {
      if d1[j].key == d0[i].key { continue }
      for k:=0;k<t;k++ {
        if d2[k].key == d0[i].key || d2[k].key == d1[j].key { continue }
        if m > d0[i].val+d1[j].val+d2[k].val { m = d0[i].val+d1[j].val+d2[k].val }
      }
    }
  }
  fmt.Println(m)
}
type Entry struct {
  key int
  val int
}
type Entries []Entry
func(entries Entries) Len() int {
  return len(entries)
}
func(entries Entries) Swap(i,j int) {
  entries[i],entries[j] = entries[j],entries[i]
}
func(entries Entries) Less(i,j int) bool {
  if entries[i].val == entries[j].val {
    return entries[i].key < entries[j].key
  } else {
    return entries[i].val < entries[j].val
  }
}

Measured memory_bytes: 4864
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}

int kai(int x) {
	if (x == 1)return 1;
	return kai(x - 1)*x%mod;
}

int mod_pow(int x, int y, int moder) {
	int res = 1;
	while (y > 0) {
		if (y & 1)res = res * x%moder;
		x = x * x%moder;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	if (x == y)return 1;
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int n, h[100010];
int cnt;

signed main(){
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> h[i];
		if (i >= 1) {
			if (cnt <= h[i] - 1)cnt = h[i] - 1;
			else if (cnt > h[i]) {
				cout << "No" << endl;
				return 0;
			}
			else cnt = h[i];
		}
		else cnt = h[i];
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int K;
  cin >> N >> K;
  int n;
  n = 1;
  for(int i=0; i < N; i++){
  int a;
  a = 2 * n;
  int b;
  b = n + K;
  if (a < b){
  n = a;
  }else{
    n = b;
  }
  }
  cout << n << endl;
}

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

typedef long long ll;
typedef pair<int,int> P;
int dx[] = {-1, 1, 0,  0};
int dy[] = { 0, 0, 1, -1};
 
int main(){
  int dp[100010];
  dp[0] = 0;
  for(int i=1; i<100005; i++){
    dp[i] = 1000000;
    int f=1;
    while(f<=i){
      dp[i] = min(dp[i-f]+1, dp[i]);
      f *= 6;
    }
    f=1;
    while(f<=i){
      dp[i] = min(dp[i-f]+1, dp[i]);
      f *= 9;
    }
  }
  int n;
  cin >> n;
  cout << dp[n] << endl;
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main(){
	int n;	cin >> n;
  	vector<int64_t> a(n);	rep(i,n) cin >> a.at(i);
  	
  	vector<int64_t> sm(n+1,0);
	rep(i,n) sm.at(i+1) = sm.at(i) + a.at(i);
// 	rep(i,n+1) cout << sm.at(i) << endl;

	map<int64_t,int64_t> mp;
  	rep(i,n+1) mp[sm.at(i)] += 1;
  	int64_t sum = 0;
  	for(auto i:mp){
      	int64_t tmp = i.second;
    	sum += (tmp-1)*tmp/2;
    }
  	cout << sum << endl;
}


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

using namespace std;

#define EPS 1e-10

struct Point{
    double x,y;

    Point(){}
    Point(double x,double y) : x(x),y(y) {}

    Point operator + (const Point &p)const{ return Point(x+p.x,y+p.y); }
    Point operator - (const Point &p)const{ return Point(x-p.x,y-p.y); }
    Point operator * (const double &k)const{ return Point(x*k,y*k); }
};

double dot(const Point &a,const Point &b){ return a.x*b.x+a.y*b.y; }
double cross(const Point &a,const Point &b){ return a.x*b.y - b.x*a.y; }
double norm(const Point &p){ return dot(p,p); }

struct Segment{
    Point s,t;
    Segment(){}
    Segment(Point s,Point t) : s(s),t(t) {}
};

#define COUNTER_CLOCKWISE 1
#define CLOCKWISE -1
#define ONLINE_BACK 2
#define ONLINE_FRONT -2
#define ON_SEGMENT 0
typedef Point Vector;

int ccw(Point p0,Point p1,Point p2){
    Vector a = p1 - p0;
    Vector b = p2 - p0;
    if(cross(a,b) > EPS){ return COUNTER_CLOCKWISE; }
    if(cross(a,b) < -EPS){ return CLOCKWISE; }
    if(dot(a,b) < -EPS){ return ONLINE_BACK; }
    if(norm(a) < norm(b)){ return ONLINE_FRONT; }
    return ON_SEGMENT;
}

bool isIntersectSS(const Segment &a,const Segment &b){
    Point s[2] = {a.s,a.t}, t[2] = {b.s,b.t};
    return (ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
            ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0);
}

int main(){
    int Q;
    Segment s1,s2;
    cin >> Q;
    while(Q--){
        cin >> s1.s.x >> s1.s.y >> s1.t.x >> s1.t.y;
        cin >> s2.s.x >> s2.s.y >> s2.t.x >> s2.t.y;
        cout << isIntersectSS(s1,s2) << endl;
    }
    return 0;
}

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

long long int arr[1000][3];

int main(void) 
{
	cin.tie(0);
	ios::sync_with_stdio(false);
 	
	int n,m;
	long long int t;
	long long int res = 0;

	cin >> n >> m;

	for(int i=0;i<n;i++)
	{
		cin >> arr[i][0] >> arr[i][1] >> arr[i][2];
	}

	for(int i=0;i<8;i++)
	{
		vector <long long int> v;
		for(int j=0;j<n;j++)
		{
			long long int temp = 0;
			int val = i;
			for(int k=0;k<3;k++)
			{
				if(val%2==0)
				{
					temp -= arr[j][k];
				}
				else
				{
					temp += arr[j][k];
				}
				val/=2;
			}
			v.push_back(temp);
		}

		sort(v.rbegin(),v.rend());

		long long int sum = 0;

		for(int j=0;j<m;j++)
		{
			sum += v[j];
		}
		res= max(res,sum);
	}

	cout << res << '\n';
	
	return 0;
}

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

int     main() {
        int W, H, x, y, r;
        cin >>W >>H >>x >>y >>r;
        bool OK=true;
        if ((x<r)||(y<r))
                OK=false;
        if ((W<x+r)||(H<y+r))
                OK=false;
        if (OK)
                cout <<"Yes" <<endl;
        else
                cout <<"No" <<endl;
        return 0;
}


Measured memory_bytes: 3092
N = int(input())

if 0 < N < 10:
  print(N)
elif 10 <= N <100:
  print(9)
elif 100 <= N < 1000:
  print(9 + N - 100 + 1)
elif 1000 <= N < 10000:
  print(909)
elif 10000<= N < 100000:
  print(909 + N - 10000 + 1)
else:
  print(90909)

Measured memory_bytes: 3064
billNum, Declation = map(int, input().split())
bill10000 = -1
bill5000  = -1
bill1000  = -1

for x in range(billNum + 1):
    for y in range(billNum + 1):
        z = billNum - x - y
        sumOfMoney = x * 10000 + y * 5000 + z * 1000
        if Declation == sumOfMoney and z * 1000 >= 0:
            bill10000 = x
            bill5000  = y
            bill1000  = z
            break

print(bill10000, bill5000, bill1000)

Measured memory_bytes: 3064
#include <stdio.h>
#include <math.h>
int main (int argc, const char * argv[]) {
        
        int a,b;
        scanf("%d %d",&a,&b);
        
        if(a < 1 || b > 100){
            return 1;
        }
        printf("%d %d\n",a*b,a*2+b*2);
        return 0;
}

Measured memory_bytes: 596
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) (a).begin(),(a).end()
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

void reader(int &a) { scanf("%d", &a); }
void reader(double &a) { scanf("%lf", &a); }
void reader(char a[]) { scanf("%s", a); }
void reader(char &a) { scanf(" %c", &a); }
void reader(ll &a) { scanf("%lld", &a); }
void reader(ull &a) { scanf("%llu", &a); }
// void reader(string& a){cin >> a;};
template<class T, class U> void reader(T& t, U& u) { reader(t); reader(u); }
template<class T, class U, class V> void reader(T& t, U& u, V& v) { reader(t); reader(u); reader(v); }

void writer(const int a, char c) { printf("%d", a); putchar(c); }
void writer(const ll a, char c) { printf("%lld", a); putchar(c); }
void writer(const ull a, char c) { printf("%llu", a); putchar(c); }
void writer(const double a, char c) { printf("%.20lf", a); putchar(c); }
void writer(const char a[]) { printf("%s", a); };
void writer(const char a[], char c) { printf("%s", a); putchar(c); };
void writer(const char a, char c) { putchar(a); putchar(c); };
template<class T> void writerLn(T t) { writer(t, '\n'); }
template<class T, class U> void writerLn(T t, U u) { writer(t, ' '); writer(u, '\n'); }
template<class T, class U, class V> void writerLn(T t, U u, V v) { writer(t, ' '); writer(u, ' '); writer(v, '\n'); }
template<class T> void writerArr(T x[], int n) { int i; if (!n) { putchar('\n'); return; }rep(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); }
template<class T> void writerVec(vector<T> x) { int n = x.size(); int i; if (!n) { putchar('\n'); return; }rep(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); }

vector<string> split(const string &str, char sep) { vector<string> v; stringstream ss(str); string buffer; while (getline(ss, buffer, sep)) { v.push_back(buffer); }return v; }
// #define int ll
bool test = 1;
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define MAX 300000
//.....................
ull mod = (int)1e9 + 7;
#define P pair<int,int>
signed main(void)
{
	int i, j, k;
	while (1) {
		int e;
		cin >> e;
		int m = INT_MAX;
		if (e == 0) return 0;
		for (i = 100; i > -1; i--) {
			if (i*i*i > e) continue;
			for (j = 1000; j > -1; j--) {
				k = e - i*i*i - j*j;
				if (k < 0) continue;
				if (i + j + k < m) m = i + j + k;
			}
		}
	end:/*
		dump(i);
		dump(j); 
		dump(k);*/
		writerLn(m);
	}
	return 0;
}

Measured memory_bytes: 1148
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define pf push_front
#define PI acos(-1)
#define EPS 1e-5
#define sz(v) ((int)(v).size())
#define all(v) v.begin(),v.end()
#define forn(i, n) for(ll i=0;i<(ll)n;i++)
#define fi first
#define se second
 

int main() {
	int n;
	cin >> n;
	string s;
	cin >> s;
	if(n % 2 != 0) cout << "No" << endl;
	else {
		bool ok = true;
		forn(i, n/2) {
			if(s[i+n/2] != s[i]){
				ok = false;
				break;
			}
		}
		if(ok) cout << "Yes" << endl;
		else cout << "No" << endl;
	}	
	return 0;
}



Measured memory_bytes: 3624
x = int(input())

if 400 <= x <= 599:
    print(8)
elif 600 <= x <= 799:
    print(7)
elif 800 <= x <= 999:
    print(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
elif 1800 <= x <= 1999:
    print(1)

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

typedef long long ll;
typedef unsigned long long ull;

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    int ans=0;
    for(int i=a;i<=b;i++){
        if(c%i==0) ans++;
    }

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


Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
#define lol long long;
#define dob double;
// size_t a =s.length();
int main(){
  string s;
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  if(a>=b) cout<<b*c+(a-b)*d<<"\n";
  else cout<<a*c<<"\n";
  return(0);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast","no-stack-protector","unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
#define int long long
#define F(i,L,R) for(register int i=L;i<R;++i)
#define FE(i,L,R) for(register int i=L;i<=R;++i)
#define getI(a) scanf("%lld",&a)
#define getII(a,b) scanf("%lld%lld",&a,&b)
#define getIII(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define VgetI(n) int (n); scanf("%lld",&(n))
#define VgetII(n,m) int (n),(m); scanf("%lld%lld",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%lld%lld%lld",&(n),&(m),&(k))
#define debug(x) cout<<(#x)<<"="<<x<<"\n";
#define qq cout<<"QQ\n";
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define f first
#define s second
#define INF 2000000000
int maxN=10000005;
int f[10000005];
void init(){
	f[1]=1;
	F(i,2,maxN) f[i]=2;
	F(i,2,maxN) for(int j=i*2;j<maxN;j+=i) f[j]++;
}
main(){
	init();
	int n;
	while(~getI(n)){
		int ans=0;
		FE(i,1,n) ans+=i*f[i];
		printf("%lld\n",ans);
	}
}


Measured memory_bytes: 81880
val MOD = 1000000007L

fun main(args : Array<String>) {
    val (n, a, b) = readLine()!!.split(" ").map { it.toLong() }

    val all = modPow(2L, n, MOD) - 1L
    val nCa = modComb(n, a, MOD)
    val nCb = modComb(n, b, MOD)

    val tmp = (nCa + nCb)%MOD

    if (all < tmp) {
        println((all-tmp)%MOD+MOD)
    } else {
        println(all-tmp)
    }
}

fun modPow(base: Long, p: Long, m: Long): Long {
    return when {
        p == 0L -> 1L
        p == 1L -> base
        p % 2L == 0L -> modPow(base, p / 2L, m).let { it*it%m }
        else -> base * modPow(base, p - 1L, m) % m
    }
}

fun modComb(n: Long, k: Long, m: Long): Long {
    if (n < k) return 0L
    val kk = Math.min(k, n-k)

    var n1 = 1L
    for (i in 1..kk) {
        n1 *= (n-i+1)
        n1 %= m
    }

    var n2 = 1L
    for (i in 1..kk) {
        n2 *= i
        n2 %= m
    }

    return n1 * modInv(n2, m) % m
}

fun modInv(n: Long, m: Long): Long {
    return modPow(n, m-2, m)
}

Measured memory_bytes: 37932
#include<stdio.h>
using namespace std;


int main(){
    int n, q;
    scanf("%d",&n);
    int S[10000], T[500];
    for(int i=0;i<n;i++) scanf("%d",&S[i]);
    scanf("%d",&q);
    for(int i=0;i<q;i++) scanf("%d",&T[i]);

    int count = 0;
    for(int i=0;i<q;i++){
        int t = T[i];
        for(int j=0;j<n;j++){
            int s = S[j];
            if(t==s) {
                count++;
                break;
            }
        }
    }
    printf("%d\n",count);
    return 0;
}


Measured memory_bytes: 2688
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
using namespace std;
#define LL long long
#define INF (LL)(1LL<<60)

void solve(long long N, std::vector<std::vector<long long>> A){
    std::vector<std::vector<long long>> d(N, vector<long long>(N));
    std::vector<std::vector<long long>> updated(N, vector<long long>(N, 0));

    for(int i=0; i<N; i++)
        for(int j=0; j<N; j++)
            d[i][j]=A[i][j];

    for(int k=0; k<N; k++)
        for(auto i=0; i<N; i++)
            for(auto j=0; j<N; j++){
                if(i!=k && k!=j && d[i][k]+d[k][j] <= d[i][j])
                    updated[i][j]=1;
                d[i][j]=min(d[i][j], d[i][k]+d[k][j]);
            }


    for(int i=0; i<N; i++) {
        for (int j = 0; j < N; j++) {
            if (d[i][j] != A[i][j]) {
                cout << "-1" << endl;
                return;
            }
        }
    }

    LL ans = 0;
    for(int i=0; i<N; i++)
        for(int j=i+1; j<N; j++)
            if(updated[i][j]!=1)
                ans += d[i][j];

    cout << ans << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::vector<long long>> A(N, std::vector<long long>(N));
    for(int i = 0 ; i < N ; i++){
        for(int j = 0 ; j < N ; j++){
            scanf("%lld",&A[i][j]);
        }
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 2432
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
ll mod = 1000000007;
ll INF = 1000000099;
//cin.tie(0);
//ios::sync_with_stdio(false);

ll dp[5010],dp2[25000000];

signed main(){
    ll n,ga,sa,ba,gb,sb,bb;
    cin>>n>>ga>>sa>>ba>>gb>>sb>>bb;
    dp[0]=n;
    for(int i=0;i <= n;i++)
    {
        if(i-ga>-1) dp[i]=max(dp[i],dp[i-ga]+gb-ga);
        if(i-sa>-1) dp[i]=max(dp[i],dp[i-sa]+sb-sa);
        if(i-ba>-1) dp[i]=max(dp[i],dp[i-ba]+bb-ba);
        if(i-1>-1) dp[i]=max(dp[i],dp[i-1]);
    }

    dp2[0]=dp[n];
    for(int j=0;j <= dp[n];j++)
    {
        if(j-gb>-1) dp2[j]=max(dp2[j],dp2[j-gb]+ga-gb);
        if(j-sb>-1) dp2[j]=max(dp2[j],dp2[j-sb]+sa-sb);
        if(j-bb>-1) dp2[j]=max(dp2[j],dp2[j-bb]+ba-bb);
        if(j-1>-1) dp2[j]=max(dp2[j],dp2[j-1]);
    }
    cout << dp2[dp[n]] << endl;

}

Measured memory_bytes: 195584
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

ll mod = 1e09;

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

  ll n;
  cin >> n;

  ll b = 1;
  while(b * 2 <= n) b *= 2;

  cout << b << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main
{
	public static void main(String arg[])
	{
		Scanner in = new Scanner(System.in);
		while(in.hasNext())
		{
			String str[] =in.next().split(",");
			double x1=Double.valueOf(str[0]);
			double y1=Double.valueOf(str[1]);
			double x2=Double.valueOf(str[2]);
			double y2=Double.valueOf(str[3]);
			double xq=Double.valueOf(str[4]);
			double yq=Double.valueOf(str[5]);
			double xr,yr;
			double a=(y1-y2)/(x1-x2);
			double b=y1-a*x1;
			if(x1==x2)
			{
				xr=xq+(x1-xq)*2;
				yr=yq;
			}
			else if(y1==y2)
			{
				xr=xq;
				yr=yq+(y1-yq)*2;
			}
			else
			{
				xr=(2*a*yq-2*a*b-a*a*xq+xq)/(a*a+1);
				yr=(xq-xr+a*yq)/a;
			}
			System.out.printf("%.6f %.6f\n",xr,yr);
		}
	}
}

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

signed main() {
	ll n;
	string s;
	cin >> n >> s;
	ll ans = 1;
	for(ll i = 1; i < n; i++){
		if(s[i - 1] != s[i]) ++ans;
	}
	cout << ans << endl;
}

Measured memory_bytes: 512
// みなさん私はカーティキー・シャルマです。LNMIITで勉強しています。私は2年目で、コロナパンデミックが発
// 生しています。世界は終わりそうだ。だから私はそれを最大限に生きたいと思っています。それはつまり、コー
// ドを最大限に意味しているのです。私の好きなアニメは「キメツノヤイバ」で、私の一番の男の子はゼニツで、
// 私の一番の女の子はネズコです。私の好きな呼吸スタイルは息吹です。私の最高の悪魔の血の芸術は、
// ククシボによって使用される月の息です。ムーザンは亡くなり、今ではタンジローがポップの新しい魔王です。
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
using namespace std;
typedef double  dbl;
typedef long long int lld;
#define PI 3.14159265358979323
#define foi(i,n) for(lld i = 0; i < n; i+=1)
#define fod(i,n) for(lld i=n-1; i >=0; i-=1)
#define MAX std::numeric_limits<lld>::max()
#define MIN std::numeric_limits<lld>::min()
#define FastIO  ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define LEN 100005
lld vis[LEN];
lld rec_ (lld pos, lld A[], lld n, lld k)
{
	if (vis[pos] == -1){
		if (pos == n) vis[pos] = 0;
		else{
			lld ans = MAX;
			for(lld i = pos+1; i <= min(pos+k, n); i += 1){
				ans = min(ans, rec_(i, A, n, k) + abs(A[pos]-A[i]));
			}
			vis[pos]= ans;
		}
	}
	return vis[pos];
}
int main ()
{
      FastIO
      lld n, k;
      cin >> n >> k;
      lld A[n+1];
      for(lld i = 1; i <= n; i += 1){
      	cin >> A[i];
      }
      for(lld i = 0; i < LEN;i += 1){
      	vis[i] = -1;
      }
      cout << rec_(1, A, n, k);
      return 0;
}

Measured memory_bytes: 12924
#include <bits/stdc++.h>
using namespace std;
 
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<n;i++)
#define ll long long
 
#define pi pair < ll , ll >
#define pb push_back
#define mp make_pair
#define F first
#define S second
 
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
 
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
using namespace std;

const ll mod = 1e9+7;

void solve() {
    ll n, m, i, j, k, a[300001], ans = 0;
    cin>>n;fo(i,n)cin>>a[i];

    fo(i,61) {
        vector < int > v;v.clear();
        ll ones = 0, zeros = 0;
        fo(j,n) {
            if(a[j]&(1ll<<i)) {
                v.pb(1);ones++;
            } else {
                v.pb(0);zeros++;
            }
        }
        for(auto x:v) {
            if(x==0) {
                ans = ( ans + ((1ll<<i)%mod)*ones) % mod;
                zeros--;
            } else {
                ans = ( ans + ((1ll<<i)%mod)*zeros) % mod;
                ones--;
            }
        }
    }
    cout<<ans;
}

int main()
{
    fastIO;ll t=1;
    // cin>>t;
    while(t--)solve();
}

Measured memory_bytes: 5892
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll min(ll x,ll y){
    if(x>=y) return y;
    else return x;
}
int main(){
    int test,count=0;
    //cin>>test;
    for(int g=0;g<1;g++){
        ll n,d;
        cin>>n>>d;
        ll x[n],y[n];
        ll c=0;
        for(ll i=0;i<n;i++){
            cin>>x[i]>>y[i];
            if((ll)pow(x[i],2)+(ll)pow(y[i],2)<=d*d) c++;
        }
        
        cout<<c;
        
    }
    return 0;
}
    

Measured memory_bytes: 6760
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <cfloat>
#include <cmath>
#include <string>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) (v).begin(),(v).end()
#define INF INT_MAX
#define BINF DBL_MAX

int main(){
	int n;
	cin >> n;
	rep(t, n){
		vector<int> v;
		string s;
		int mx = 0, mn = 0;
		cin >> s;
		rep(i, 8){
			int x = s[i] - '0';
			v.push_back(x);
		}
		sort(all(v));
		for (int i = 0; i < 8; i++){
			mx += v[i] * (int)pow(10, i);
		}
		for (int i = 0; i < 8; i++){
			mn += v[i] * (int)pow(10, 7 - i);
		}
		cout << mx - mn << endl;
	}
	return 0;
}

Measured memory_bytes: 1268
/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/
 
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x
 
using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;
 
const ll MODBASE = 1000000007LL;
const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    string s;
    cin >> s;
    if (s[0] != s[1] || s[1] != s[2]) cout << "Yes";
    else cout << "No";
    return 0;
}


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

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int n, t = 4;
	cin >> n;
	int k = 0;
	while (--t) {
		if ( n%10 == 1) ++k;
		n /= 10;

	}
	
	cout << k;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#define NUM 100000
using namespace std;
int main(){
  int n, prime[NUM+1], x1,x2;
  prime[1]=0;
  for(int i=2; i<NUM+1; i++) prime[i] = 1;
  for(int i=2; i<=NUM/2; i++){
      for(int j=2; i*j <= NUM; j++){
      	  prime[i*j]=0;
      }
  }

  while(cin >> n){
    if(n < 3 || n > 50000) return 0;
    for(int i=1; i<NUM; i++){
      if(prime[n-i] == 1){
      	  x1 = n-i;
      	  break;
      }
    }
    for(int i=1; i<NUM; i++){
      if(prime[n+i] == 1){
      	  x2 = n+i;
      	  break;
      }
  	}
  	
  	cout << x1 << " " << x2 << endl;

  }
  return 0;
  
}

Measured memory_bytes: 0
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let a: i32 = read();
    let b: i32 = read();
    let c: i32 = read();
    println!("{}", if a == b { c } else if b == c { a } else { b });
}

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


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define LL long long
#define FOR(i,c) for(__typeof(c.begin()) i = c.begin(); i != c.end(); i++)
#define F first
#define S second
using namespace std;

const LL mod = 1e9 + 7;

template<typename T> T gcd(T a, T b) { return b == 0?a: gcd(b, a % b); }
template<typename T> T LCM(T a, T b) { return a*(b/gcd(a, b)); }
template<typename T> T expo(T base, T e, T mod) { T res = 1;
  while(e > 0) { if(e&1) res = res * base % mod; base = base * base % mod; e >>= 1; }
  return res;
}
template<typename T, typename S> T expo(T b, S e){if(e <= 1)return e == 0?1: b;\
	return (e&1) == 0?expo((b*b), e>>1): (b*expo((b*b), e>>1));}
template<typename T, typename S> T modinv(T a, S mod) { return expo(a, mod-2, mod); }
template<class T, class S> std::ostream& operator<<(std::ostream &os, const std::pair<T, S> &t) {
	os<<"("<<t.first<<", "<<t.second<<")";
	return os;
}
template<class T> std::ostream& operator<<(std::ostream &os, const std::vector<T> &t) {
	os<<"["; FOR(it,t) { if(it != t.begin()) os<<", "; os<<*it; } os<<"]";
	return os;
}

const int MAXN = 1e5 + 100;
int arr[MAXN];

int main() {
  ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	int minim = 1e9, maxim = 0;
	for(int i = 1; i <= n; i++) {
		cin >> arr[i];
		minim = min(minim, arr[i]);
		maxim = max(maxim, arr[i]);
	}
	bool ok = true;
	if(maxim - minim == 1) {
		int rhs = 0;
		for(int i = 1; i <= n; i++) {
			if(maxim == arr[i]) {
				rhs++;
			}
		}
		int cx = n - rhs;
		int beta = minim - cx + 1;
		if(2*beta <= rhs && 2*beta > 0) {
			ok = true;
		} else {
			ok = false;
		}
	} else if(maxim == minim) {
		if(2*maxim <= n || n - 1 == maxim) ok = true;
		else ok = false;
	} else {
		ok = false;
	}
	if(ok) cout << "Yes\n";
	else cout << "No\n";
  return 0;
}


Measured memory_bytes: 640
var
	n,a,c,i:Longint;
	u:array[1..100000]of Boolean;
begin
	read(n);
	for i:=1 to n do begin
		read(a);
		if not u[a] then inc(c);
		u[a]:=true;
	end;
	if c mod 2=0 then writeln(c-1)else writeln(c);
end.


Measured memory_bytes: 256
from bisect import bisect_left
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
cnt = 0

def find_idx(l, x):
    i = bisect_left(l, x)
    if i != len(l) and l[i] == x:
        return 1
    else:
        return 0

for i in T:
    cnt += find_idx(S, i)

print(cnt)


Measured memory_bytes: 16740
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<cmath>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

#define big ((ll)(1e9)+7)

bool my_compare(pair<ll, ll> a, pair<ll, ll> b) {
    // 基本はfirstで比較
    if(a.first != b.first){
        return a.first < b.first; // 昇順
        // return a.first > b.first; // 降順
    }

    // それ以外はsecondで比較
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        // どちらも同じ
        return true;
    }
}

int main()
{
  ll n;
  cin >> n;
  vector<pair<ll,ll> > ab;
  for(ll i = 0;i < n;i++)
  {
    ll A,B;
    cin >> A >> B;
    ab.push_back(make_pair(B,A));
  }
  sort(ab.begin(),ab.end(),my_compare);
  // for(ll i = 0;i < n;i++)
  // {
  //   cout << ab[i].second << " " << ab[i].first << endl;
  // }
  ll ans = 0;
  for(int i = 0;i < n;i++)
  {
    ans += ab[i].second;
    if(ans > ab[i].first)
    {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 6256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n; cin >> n;
  map< int, int, greater<int> > mp;
  for (int _ = 0; _ < 1 << n; ++_) {
    int a; cin >> a;
    ++mp[a];
  }
  priority_queue<int> pq;
  pq.push(1 << n);
  for (const auto& e : mp) {
    if (e.second > (int)pq.size()) {
      return cout << "No" << '\n', 0;
    }
    V<> v;
    for (int _ = 0; _ < e.second; ++_) {
      v.push_back(pq.top()); pq.pop();
    }
    for (int e : v) {
      for (int i = 1; i < e; i *= 2) {
        pq.push(i);
      }
    }
  }
  cout << "Yes" << '\n';
}

Measured memory_bytes: 13180
<?php
list($num,$ver,$hor)=explode(" ",trim(fgets(STDIN)));
$count=0;


for($i=0;$i<$num;$i++){
  $alloy=explode(" ",trim(fgets(STDIN)));
    if ($ver<=$alloy[0] && $hor<=$alloy[1]){
        $count++;
    }
}
echo $count;
?>

Measured memory_bytes: 4604
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	string s, t; cin >> s >> t;
	int a, b; cin >> a >> b;
	string u; cin >> u;
	if (u == s) cout << a - 1 << " " << b;
	else cout << a << " " << b - 1;

	return 0;
}

Measured memory_bytes: 3140
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	int H, W;
	cin >> H >> W;

	char c[101][101];
	int a[101][101];

	for (int i = 1; i <= H; i++)
		for (int j = 1; j <= W; j++) {
			cin >> c[i][j];
			a[i][j] = -1;
		}

	for (int t = 0; t < W; t++)
		for (int i = 1; i <= H; i++)
			for (int j = 1; j <= W; j++)
				if (j - t > 0 && c[i][j - t] == 'c')
					if (a[i][j] == -1 || a[i][j] > t)
						a[i][j] = t;

	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			cout << a[i][j];
			if (j != W) cout << " ";
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1208
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 1e-5
#define LONG_INF 2000000000000000000LL
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144
#define REP(a,b) for(long long a = 0;a < b;++a)
int main() {
	int n;
	cin >> n;
	cout << (n - 1) / 2 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s, b, ans;
    cin >> s;
    ans = "Yes";
    int tmp = s.length() / 2;
    if (s.length() % 2 != 1)
    {
        for (int i = 0; i < tmp; i += 2)
        {
            if (s.substr(i, 2) != "hi")
            {
                ans = "No";
                break;
            }
        }
    }
    else
    {
        ans = "No";
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int numx = 0;
        int numy = 0;
        int[][] bingo = new int[3][3];
        while (numx < 3) {
            while(numy < 3) {
                int nextNum = sc.nextInt();
                bingo[numx][numy] = nextNum;
                numy++;
            }
            numx++;
            numy=0;
        }

        int bingoNum = sc.nextInt();
        List<Integer> numList = new ArrayList<>();
        while(bingoNum > 0) {
            int nextNum = sc.nextInt();
            numList.add(nextNum);
            bingoNum--;
        }

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (numList.contains(bingo[i][j])) {
                    bingo[i][j] = 1000;
                }
            }
        }

        if (
                (bingo[0][0]==1000 && bingo[0][1]==1000 && bingo[0][2]==1000) ||
                        (bingo[1][0]==1000 && bingo[1][1]==1000 && bingo[1][2]==1000) ||
                        (bingo[2][0]==1000 && bingo[2][1]==1000 && bingo[2][2]==1000) ||
                        (bingo[0][0]==1000 && bingo[1][0]==1000 && bingo[2][0]==1000) ||
                        (bingo[0][1]==1000 && bingo[1][1]==1000 && bingo[2][1]==1000) ||
                        (bingo[0][2]==1000 && bingo[1][2]==1000 && bingo[2][2]==1000) ||
                        (bingo[0][0]==1000 && bingo[1][1]==1000 && bingo[2][2]==1000) ||
                        (bingo[0][2]==1000 && bingo[1][1]==1000 && bingo[2][0]==1000)

        ) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 23764
import Data.Foldable (traverse_)
import Data.Functor ((<$>))

main = do
  xs <- takeWhile (\[x, y] -> [x, y] /= [0, 0]) . map (map read . words) . lines <$> getContents
  traverse_ printBox xs
  where
  printBox [h, w] = putStrLn $ unlines $
    take h $ cycle $ map (take w) [cycle "#.", cycle ".#"]



Measured memory_bytes: 4572
n = int(input())

ans = []
for i in range(1, 99): # 99は適当
    if n <= 26**i:
        n -= 1 # これが必要
        for j in range(i):
            ans.append(chr(ord('a') + n % 26))
            n //= 26
        break
    else:
        n -= 26**i

print(''.join(ans[::-1]))

Measured memory_bytes: 9156
#include<iostream>
#include<cstring>
using namespace std;
int main(){
    
    long long int n,ans=0,i,j,k;
    cin>>n;
    long long int a[n+1][n+1];
    bool p[n+1][n+1];
    memset(p,0,sizeof(p));
    for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
            cin>>a[i][j];
    //读入数据以及初始化操作

    for(k=1;k<=n;k++)      
        for(i=1;i<=n;i++)
            for(j=1;j<=n;j++){
                if(k!=j&&k!=i&&i!=j){
                    if(a[i][j]==a[i][k]+a[k][j])
                        p[i][j]=1;  //标记
                    if(a[i][j]>a[i][k]+a[k][j]){
                        cout<<"-1"<<endl;  //不是最短路，无解
                        return 0;
                    }
                }
            }
    //核心操作语句

    for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
            if(p[i][j]==0)
                ans+=a[i][j]; //统计长度总和
    cout<<ans/2<<endl;
    //统计总和及输出

    return 0;
}

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

int main () {
	int h,w;
	while ( cin >> h >> w){
		if  ( h == 0 && w == 0){
			break;
		}
		for ( int b = 0 ; b < h ; b++){
			for ( int a = 0 ; a < w ; a++){
				cout << '#';
				a++;
				if ( a < w ){
					cout << '.';
				}
			}
			b++;
			cout << endl;
			if ( b < h ){
				for ( int c = 0 ; c < w ; c++){
					cout << '.';
					c++;
					if  ( c < w){
						cout << '#';
					}
				}
				cout << endl;
			}
		}
		cout << endl;
	}
	return 0;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

const int NUM_MAX = 110000;

int main()
{
    vector<bool> candidates(NUM_MAX, true);
    candidates[0] = false;
    candidates[1] = false;
    for (int i = 2; i * i < NUM_MAX; i++)
        if (candidates[i])
            for (int j = i * i; j < NUM_MAX; j += i)
                candidates[j] = false;
    vector<int> primes;
    for (int i = 0; i < candidates.size(); i++) {
        if (candidates[i])
            primes.push_back(i);
    }
    int x;
    cin >> x;
    auto it = lower_bound(primes.begin(), primes.end(), x);
    cout << *it << endl;
    return 0;
}


Measured memory_bytes: 384