akhauriyash/Code-Regression huggingface dataset:
from collections import Counter

n, p = map(int, input().split())
s = input()

ans = 0

if p in {2, 5}:
    lst = set(i for i in range(0, 10, p))
    for i, num in enumerate(s):
        if int(num) in lst:
            ans += i + 1
else:
    num = [0]
    for i in range(len(s)):
        tmp = num[-1] + pow(10, i, p) * int(s[-i - 1])
        num.append(tmp % p)
    mod = [0] * p
    for i in num:
        ans += mod[i]
        mod[i] += 1
print(ans)


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



int main()
{
	double s;
	cin>>s;
	
	 double length = s / 3; 
  
      s -= length; 
  
    
    double breadth = s / 2; 
  
     
    double height = s - breadth; 
  
    double v=(length*breadth*height);
    cout<<fixed<<setprecision(12)<<v;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define POWER9 1000000000
#define MOD POWER9+7
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359

int H,W;
string S[8];
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << setprecision(9);

	cin >> H >> W;
	for(int i=0; i<H; i++) cin >> S[i];
	bool checked[8][8] = {};
	int y = 0; int x = 0;
	checked[y][x] = true;
	while(y != H-1 || x != W-1){
		int c = 0;
		if(y < H-1 && S[y+1][x] == '#') c++;
		if(x < W-1 && S[y][x+1] == '#') c++;
		if(c != 1){
			cout << "Impossible" << endl;
			return 0;
		}
		if(y < H-1 && S[y+1][x] == '#') y++;
		else x++;
		checked[y][x] = true;
	}
	for(int i=0; i<H; i++){
		for(int j=0; j<W; j++){
			if((checked[i][j]&&S[i][j]=='#') || (!checked[i][j]&&S[i][j]=='.')){
			}
			else{
				cout << "Impossible" << endl;
				return 0;
			}
		}
	}
	cout << "Possible" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define bitrep(X,N) for(ll X = 0; X < (1 << (N)); X++)
#define PI (acos(-1.0))
#define sorta(V) sort(V.begin(), V.end())
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end() 


using namespace std;


int main(){

    int n,m;
    cin >> n >> m;

    vector<tuple<ll,ll,ll>> v;

    

    rep(i,n){
        ll x,y,z;
        cin >> x >> y >> z;

        v.pback(make_tuple(x,y,z));
    }

    tuple<ll, ll, ll> dp[1001][1001][8];

    function<ll(tuple<ll,ll,ll>, int)> eval = [=](tuple<ll,ll,ll> tu, int t) -> ll{

        ll tmp = 0;

        ll x = get<0>(tu);
        ll y = get<1>(tu);
        ll z = get<2>(tu);

        if(t & 1){
            tmp += x;
        }else tmp -= x;

        if(t & 2){
            tmp += y;
        }else tmp -= y;

        if(t & 4){
            tmp += z;
        }else tmp -= z;
        
        return tmp;
    };

    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= i; j++){
            rep(k,8){

                if(i == j){

                    ll tmpx = get<0>(dp[i - 1][j - 1][k]) + get<0>(v[i - 1]);
                    ll tmpy = get<1>(dp[i - 1][j - 1][k]) + get<1>(v[i - 1]);
                    ll tmpz = get<2>(dp[i - 1][j - 1][k]) + get<2>(v[i - 1]);

                    dp[i][j][k] = make_tuple(tmpx,tmpy,tmpz);
                    
                }else{
                    ll tmp = eval(dp[i - 1][j][k], k);

                    ll tmpx = get<0>(dp[i - 1][j - 1][k]) + get<0>(v[i - 1]);
                    ll tmpy = get<1>(dp[i - 1][j - 1][k]) + get<1>(v[i - 1]);
                    ll tmpz = get<2>(dp[i - 1][j - 1][k]) + get<2>(v[i - 1]);

                    tuple<ll,ll,ll> tmpt = make_tuple(tmpx,tmpy,tmpz);

                    if(eval(tmpt,k) > tmp){
                        dp[i][j][k] = tmpt;
                    }else{
                        dp[i][j][k] = dp[i - 1][j][k];
                    }

                }
            }
        }
    }

    

    ll ans = 0;

    rep(i,8){

        ll x = abs(get<0>(dp[n][m][i]));
        ll y = abs(get<1>(dp[n][m][i]));
        ll z = abs(get<2>(dp[n][m][i]));

        ans = max(ans, x + y + z);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 188160
s = list(input())
t = list(input())
ll = []
for i in range(len(s)-len(t)+1):
    l = s[i:(i+len(t)+1)]
    num = 0
    for j in range(len(t)):
        if l[j]==t[j]:
            num +=1
    ll.append(num)
print(len(t)-max(ll))

Measured memory_bytes: 9040
// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
int n, cnt[N];

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n;
    int a;
    for (int i = 0; i < n; i++){
        cin>>a;
        cnt[a+1]++;
        cnt[a]++;
        cnt[a+2]++;
    }
    
    cout<<*max_element(cnt, cnt+(int)100002)<<endl;
    
    
    
    return 0;
}



Measured memory_bytes: 640
// Remeber Choose Compiler: GCC9
#include <bits/stdc++.h>

using namespace std;

// Debug Output Utility
#ifdef LOCAL
#define dbg(args...)             \
    do {                         \
        cout << #args << " -> "; \
        err(args);               \
    } while (0)
void err() { std::cout << std::endl; }
template <typename T, typename... Args>
void err(T a, Args... args) {
    std::cout << a << ' ';
    err(args...);
}
template <template <typename...> class T, typename t, typename... A>
void err(const T<t> &arg, const A &... args) {
    for (auto &v : arg)
        std::cout << v << ' ';
    err(args...);
}
#else
#define dbg(...)
#endif

// Macro Definitions:
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()

// Type Alias:
using int64 = long long;
using PII   = pair<int, int>;

// Global Const Variable
const int64 INF = 0x3f3f3f3f3f3f3f3f;
const int MOD   = 1000000007;
const int MAXN  = 200005;

int64 a[MAXN], b[MAXN];
int64 n, m, k;


void run() {
    int n;
    cin >> n;
    string s;
    map<string,int> m;
    for(int i=0;i<n;i++) {
        cin >> s;
        m[s]++;
    }
    vector<string> ss {"AC","WA","TLE","RE"};
    for(auto s:ss) {
        cout << s << " x " << m[s] << endl;
    }
}

// Debug Input Redirection
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
#endif
    run();
}


Measured memory_bytes: 3660
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
import itertools
INF = 10**9
MOD = 10**9+7

n = int(input())
a = [int(x) for x in input().split()]
idx = [0] * n
for i, x in enumerate(a, 1):
    idx[x-1] = i
print(*idx)


Measured memory_bytes: 14196
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

string S;

int main(){
  int a,b;
  cin  >> a >> b;
  int ans=0;
  int p=b-a;
  ans=p*(p+1)/2-b;
  cout << ans << endl;
  return 0;
}

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

abl = []
for _ in range(n):
    a,b = map(int,input().split())
    abl.append((a,b))
    
abl = sorted(abl)

ans = 0
now = 0
for a,b in abl:
    need = m - now
    now += min(need, b)
    ans += min(need, b) * a
    if now == m:
        break
    
print(ans)

Measured memory_bytes: 54292
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const int INF=1000000001;
const double PI=3.141592653589;


int main(){
  int n; cin>>n;
  map<int,int> mp;
  rep(i,n){
    int a; cin>>a;
    mp[a]++;
  }
  int ans=0;
  for(auto itr=mp.begin();itr!=mp.end();itr++){
    int f=itr->fs;
    int s=itr->sc;
    if(s<f)
    ans+=s;
    else
    ans+=s-f;
    // cout<<f<<" "<<s<<endl;
  }
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 4736
#include <bits/stdc++.h>
using namespace std;
long long n, k, arr[110], dp[100100];
int fun(long long x)
{
    if (x < 0)
        return 1;
    if (dp[x] != -1)
        return dp[x];
    for (long long y = 0; y < n; y++)
        if (fun(x - arr[y]) == 0)
            return dp[x] = 1;
    return dp[x] = 0;
}
int main()
{
    long long x, y;
    cin >> n >> k;
    for (x = 0; x < n; x++)
        cin >> arr[x];
    memset(dp, -1, sizeof(dp));
    long long ans = fun(k);
    if (dp[k] == 1)
        cout << "First" << endl;
    else
        cout << "Second" << endl;
}

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

static const int Len = 200000;
int a[Len];

int main() {
	
	int n;
	cin >> n;
	for ( int i = 0; i < n; i++ ) cin >> a[i];
	
	int maxV = -1000000001; // ????????????????°?????¶???? 
	int minV = a[0]; // ????¬¬????????°??????????°????
	 
	for ( int i = 1; i < n; i++ ) {
		maxV = max(maxV, a[i] - minV); // ??´??°?????§??? 
		minV = min(minV, a[i]); // ??´??°??????????°???? 
	}
	
	cout << maxV << endl;
	
	return 0;
}

Measured memory_bytes: 3828
/** MIT License Copyright (c) 2018 Vasilyev Daniil **/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template<typename T> using v = vector<T>;
#define int long long
typedef string str;
typedef vector<int> vint;
#define rep(a,l,r) for(int a = (l); a < (r); a++)
#define pb push_back
#define sz(a) ((int) a.size())
const int inf = 4611686018427387903;//2^62-1
#if 0  //FileIO
const string fileName = "";
ifstream fin ((fileName == "" ? "input.txt"  : fileName + ".in" ));
ofstream fout((fileName == "" ? "output.txt" : fileName + ".out"));
#define get fin>>
#define put fout<<
#else
#define get cin>>
#define put cout<<
#endif
#define eol put endl
void read() {}     template<typename Arg,typename... Args> void read (Arg& arg,Args&... args){get (arg)     ;read(args...) ;}
void print(){}     template<typename Arg,typename... Args> void print(Arg  arg,Args...  args){put (arg)<<" ";print(args...);}
void debug(){eol;} template<typename Arg,typename... Args> void debug(Arg  arg,Args...  args){put (arg)<<" ";debug(args...);}
int getInt(){int a; get a; return a;}
//code goes here
int s(int n){
    int d=0;
    while(n){d+=n%10;n/=10;}return d;
}
void run() {
    int k;get k;
    int d=1;
    int l=0;
    int g=1;
    while(k){
        int cur=d*g+l,nxt=(d+1)*g+l;
        int z=cur*s(nxt),x=(nxt)*s(cur);
        if(z>x){
            l=l*10+9;
            d++;d/=10;
            g*=10;
        } else{
            put d*g+l;eol;
            d++;
        k--;

        }
    }
}
int32_t main() {srand(time(0));ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);run();return 0;}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define rep1(i,n)for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=(int)(n)-1;0<=i;i--)
#define rrep1(i,n) for(int i=(int)(n);1<=i;i--)

#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define all(obj) (obj).begin(),(obj).end() 

#define pcount __builtin_popcount
#define SZ(x) ((int)(x).size())
#define LEN(x) ((int)(x).length())

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define endl "\n"

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

typedef long long lint;

using namespace std;
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b,n;
	cin>>a>>b>>n;
	cout<<ceil(float(n)/max(a,b))<<endl;
}

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

int64_t solve(int64_t n, vector<int64_t> &as, vector<vector<int64_t>> &dp, int i, int j)
{
	if (dp[i][j] != -(1LL << 60))
	{
		return dp[i][j];
	}
	if (i + j == n)
	{
		return 0;
	}
	return dp[i][j] = max(as[i] - solve(n, as, dp, i + 1, j), as[n - j - 1] - solve(n, as, dp, i, j + 1));
}

int main()
{
	int64_t n;
	cin >> n;
	vector<int64_t> as(n);
	for (auto &a : as)
	{
		cin >> a;
	}
	vector<vector<int64_t>> dp(n + 1, vector<int64_t>(n + 1, -(1LL << 60)));
	cout << solve(n, as, dp, 0, 0) << endl;
	return 0;
}

Measured memory_bytes: 71040
#include <stdio.h>
         
        int main(void){
            int N;
            int sum = 0;
           
            scanf("%d",&N);
            int b[N];
            for(int i=0;i<N;i++){
    		scanf("%d",&b[i]);
    		sum = sum + b[i];
    	}
            printf("%d\n",sum-N);
            return 0;
        }

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    long long int A[N];
    long long int ans = 1;
    for(int i = 0;i < N;i++)cin >> A[i];
    vector<long long int> L(1000100);
    for(int i = 0 ;i < 1000100;i++)L[i] = 0;
    for(int i = 0;i < N;i++){
        L[A[i]]++;
    }
    int memo = 0;
    bool frag = 1;
    for(int i = 0;i < 1000010;i++){
        
        if(i == 0){
            if(L[i] !=  1 && L[i] != 0)frag = 0;
        }else{
            if(L[i] != 2 && L[i] != 0)frag = 0;
            if(L[i] == 2)memo++;
        }
    }
    for(int i = 0;i < memo;i++){
        ans = ans * 2 % 1000000007;
    }
    if(frag)cout << ans << endl;
    else cout << 0 << endl;
    
}

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

int main()
{
    int n;
    cin>>n;
    int arr[n][3];
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++){
           cin>>arr[i][j]; 
        }
    }
    int dp[n][3];
    dp[0][0]=arr[0][0];
    dp[0][1]=arr[0][1];
    dp[0][2]=arr[0][2];
    for(int i=1;i<n;i++){
        for(int j=0;j<3;j++){
            dp[i][j]=max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3]) + arr[i][j];
        }
    }
   
    cout<< max(max(dp[n-1][1],dp[n-1][2]),dp[n-1][0]);

    return 0;
}

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

const long N = 100;
const long WHITE = 0;
const long GRAY = 1;
const long BLACK = 2;

long n, M[N + 1][N + 1];
long color[N + 1], d[N + 1], f[N + 1], tt;
long nt[N + 1];

long next(long u){
	for (long v = nt[u]; v <= n; v++){
		nt[u] = v + 1;
		if (M[u][v]) return v;
	}
	return -1;
}

void dfs_visit(long r){
	for (long i = 1; i <= n; i++) nt[i] = 1;

	stack<long> S;
	S.push(r);
	color[r] = GRAY;
	d[r] = ++tt;

	while (!S.empty()){
		long u = S.top();
		long v = next(u);
		if (v != -1){
			if (color[v] == WHITE){
				color[v] = GRAY;
				d[v] = ++tt;
				S.push(v);
			}
		}
		else {
			S.pop();
			color[u] = BLACK;
			f[u] = ++tt;
		}
	}
}

void dfs(){
	for (long i = 1; i <= n; i++){
		color[i] = WHITE;
		nt[i] = 1;
	}
	tt = 0;

	for (long u = 1; u <= n; u++){
		if (color[u] == WHITE) dfs_visit(u);
	}
	for (long i = 1; i <= n; i++){
		cout << i << " " << d[i] << " " << f[i] << endl;
	}
}

int main(){
	long u, k, v;
	cin >> n;
	for (long i = 1; i <= n; i++){
		for (long j = 1; j <= n; j++){
			M[i][j] = 0;
		}
	}

	for (long i = 1; i <= n; i++){
		cin >> u >> k;
		for (long j = 1; j <= k; j++){
			cin >> v;
			M[u][v] = 1;
		}
	}

	dfs();

	return 0;
}

Measured memory_bytes: 1284
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    X,Y=pin()
    cond=0
    for i in range(X+1):
        if 4*i+2*(X-i)==Y:
            cond=1
    print(["No","Yes"][cond])
#%%submit!
resolve()

Measured memory_bytes: 61712
#include"bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 1000000007;
const long long inf = 11451419198109311;
const long double pi = 3.1415926535897932384626433;
typedef pair<int, int> P;
typedef pair<int, P> PP;
struct edge { int to, cost; };
int used[100005];
int a[100005], b[100005];
signed main() {
	int n; cin >> n;
	rep(i, n)cin >> a[i]>>b[i];
	priority_queue<PP>T;
	rep(i, n) {
	//a[i]-b[i],a[i],i
		T.push(PP(a[i] + b[i], P(a[i], b[i])));
	}
	int ts = 0, as = 0;
	rep(i, n) {
		PP p = T.top();
		T.pop();
		if (i & 1) {
			as += p.second.second;
		}
		else {
			ts += p.second.first;
		}
	}
	cout << ts - as << endl;
}

Measured memory_bytes: 6388
N, M = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(M)]

g = [[0] * N for _ in range(N)]
for i, j in l:
  g[i - 1][j - 1] = 1
  g[j - 1][i - 1] = 1

def dfs(n):
  v[n - 1] = 1
  for n2 in range(1, N + 1):
    if g[n - 1][n2 - 1] == 1 and v[n2 - 1] == 0:
      dfs(n2)

r = 0
for i, j in l:
  g[i - 1][j - 1] = 0
  g[j - 1][i - 1] = 0
  
  v = [0] * N
  dfs(i)
  if sum(v) != N:
    r += 1
  
  g[i - 1][j - 1] = 1
  g[j - 1][i - 1] = 1
  
print(r)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
typedef long long ll;
int main(){
    int a,b,c,x,y;
    cin >> a >> b >> c >> x >> y;
    ll ans = 1e18;
    rep(i,max(x,y)+1){
        ll tmp = c*i*2;
        tmp += max(0,x-i)*a;
        tmp += max(0, y - i) * b;
        ans = min(ans,tmp);
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  IOS;
  string s; cin >> s;
  map<string, int> m = {
    { "SUN", 7 },
    { "MON", 6 },
    { "TUE", 5 },
    { "WED", 4 },
    { "THU", 3 },
    { "FRI", 2 },
    { "SAT", 1 }
  };
  COUT(m[s]);
  return 0;
}


Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        v: [usize; n]
    }
    let mut ans = 0;
    let mut c = 0;
    for i in 1..n {
        if v[i - 1] >= v[i] {
            c += 1;
        } else {
            ans = max(ans, c);
            c = 0;
        }
    }
    println!("{}", max(ans, c));
}


Measured memory_bytes: 4352
package main

import (
        "fmt"
)

func solution(n int, matrix [][3]int) string {
        matrix = append([][3]int{{0, 0, 0}}, matrix...)

        for i := 0; i < n; i++ {
                t := matrix[i+1][0] - matrix[i][0]
                d := abs(matrix[i+1][1]-matrix[i][1]) + abs(matrix[i+1][2]-matrix[i][2])
                if d > t || t%2 != d%2 {
                        return "No"
                }
        }
        return "Yes"
}

func abs(x int) int {
        if x < 0 {
                return -x
        }
        return x
}

func main() {
        var n int
        fmt.Scan(&n)
        matrix := make([][3]int, n)
        for i := range matrix {
                fmt.Scan(&matrix[i][0])
                fmt.Scan(&matrix[i][1])
                fmt.Scan(&matrix[i][2])
        }
        fmt.Println(solution(n, matrix))
}

Measured memory_bytes: 8192
using System;
using System.Linq;

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

            int cnt;
            if (N.Contains('R') == false) cnt = 0;
            else if(N[0] == 'R')
            {
                if (N[1] == 'R')
                {
                    if (N[2] == 'R') cnt = 3;
                    else cnt = 2;
                }
                else
                {
                    cnt = 1;
                }
            }
            else
            {
                if (N[1] == 'R')
                {
                    if (N[2] == 'R') cnt = 2;
                    else cnt = 1;
                }
                else
                {
                    if (N[2] == 'R') cnt = 1;
                    else cnt = 0;
                }
            }
                

            Console.WriteLine(cnt);
        }
    }
}


Measured memory_bytes: 26308
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1 LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
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; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main() {
    string S;cin >> S;
    string ans;
    cout << S[0] << S.size() - 2 << S[S.size()-1] << endl;

}

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

int main()
{
	char c;
	cin >> c;
	c++;
	cout << c << endl;
	return 0;
}

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

divisors = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        divisors.append(i)
        if i != n//i:
            divisors.append(n//i)
divisors.sort()
#print(divisors)

l = len(divisors)
if l % 2 == 0:
    a = divisors[:int(l/2)]
    b = divisors[int(l/2):]
    b.sort(reverse=True)
    c = []
    for i in range(int(l/2)):
        c.append(a[i]+b[i])
    print(min(c)-2)
        
else:
    a = divisors[:int(l/2)]
    b = divisors[int((l+1)/2):]
    b.sort(reverse=True)
    c = divisors[int((l-1)/2)]
    d = []
    for i in range(int((l-1)/2)):
        d.append(a[i]+b[i])
    print(min(min(d), c*2) - 2)


Measured memory_bytes: 40428
s = input()
s += '<' if s[-1] == '>' else '>'
n = len(s)
f = lambda x: x * (x + 1) // 2

ans = 0
a, k = 1, 0
for i in range(n-1):
    if s[i] == s[i+1]:
        a += 1
        ans += a
    else:
        if s[i] == '<':
            k = a
        else:
            ans -= min(a, k)
        a = 1
        ans += a
print(ans)

Measured memory_bytes: 4108
#include<bits/stdc++.h>
#define fo(i,a,b)for(int i=a,_e=b;i<=_e;++i)
#define fd(i,a,b)for(int i=b,_e=a;i>=_e;--i)
#define ll long long
using namespace std;
const int N=1005;
int n,x,y,w,i,js,la[N*2],T;
int d[N*N*2],fr[N*2];
ll ans,f[N*2];
bool vi[N*2];
struct edge{
	int ne,y,l,c;
}e[N*20];
void link(int x,int y,int l,int c){
	e[++js]=(edge){la[x],y,l,c};la[x]=js;
	e[++js]=(edge){la[y],x,0,-c};la[y]=js;
}
int main(){
	cin>>n;js=1;T=n+n+5;
	fo(i,1,n){
		cin>>x>>y>>w;
		link(0,i,w,0);
		link(i,n+n+1,w,-x-y);
		link(i,n+n+2,w,-x+y);
		link(i,n+n+3,w,x-y);
		link(i,n+n+4,w,x+y);
	}
	fo(i,1,n){
		cin>>x>>y>>w;
		link(n+i,T,w,0);
		link(n+n+1,n+i,w,x+y);
		link(n+n+2,n+i,w,x-y);
		link(n+n+3,n+i,w,-x+y);
		link(n+n+4,n+i,w,-x-y);
	}
	for(;;){
		fo(i,0,T)f[i]=1e18;
		f[0]=0;vi[0]=1;
		for(int l=0,r=1,x,y;x=d[++l],l<=r;vi[x]=0)
			for(int i=la[x];i;i=e[i].ne)
				if(e[i].l&&f[x]+e[i].c<f[y=e[i].y]){
					f[y]=f[x]+e[i].c;
					fr[y]=i^1;
					if(!vi[y])d[++r]=y,vi[y]=1;
				}
		if(f[T]==1e18)break;
		int mi=10000;
		for(int x=T;x;x=e[fr[x]].y)
			mi=min(mi,e[fr[x]^1].l);
		ans+=f[T]*mi;
		for(int x=T;x;x=e[fr[x]].y)
			e[fr[x]].l+=mi,e[fr[x]^1].l-=mi;
	}
	cout<<-ans;
}

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

#define rep(ver,n) rep2(ver,0,n)
#define rep2(ver,m,n) for(int ver=m;ver<(n);ver++)
#define loop while(true)
#define dup(x,y) (((x)+(y)-1)/(y))
#define all(v) (v).begin(), (v).end()
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

typedef long long ll;
typedef pair<int, int> P;

string s,t;

int main(){
  cin>>s>>t;
  
  int ans = 1001;
  
  
  rep(i,(int)s.size()-(int)t.size()+1){
    int temp=0;
    rep(j,(int)t.size()){
      if(s[i+j]!=t[j])temp++;
    }
    ans=min(ans,temp);
  }
  
  cout<<ans;
  
  return 0;
}


Measured memory_bytes: 3624
#include <iostream>

using namespace std;

int main(){
    int h;
    int n;
    cin >> h >> n;
    int result = 0;
    int a;
    for(int i = 0; i < n; i++){
        cin >> a;
        result = result + a;
    }
    if(result >= h){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

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

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct qu{
  int p;
  int y;
  int x;
  int index;
} node;

int cmpY(const void *a,const void *b){
  return ((node *)a)->y-((node *)b)->y;
}

int cmpIndex(const void *a,const void *b){
  return ((node *)a)->index-((node *)b)->index;
}

void print(int n){
  int s[6];
  int k=0;
  while(n>0){
    s[k++]=n%10;
    n/=10;
  }
  while(k<6) s[k++]=0;
  while(k>0) printf("%d",s[--k]);
}

void run(void){
  int n,m;
  scanf("%d%d",&n,&m);
  node *a=(node *)calloc(m,sizeof(node));
  int i;
  for(i=0;i<m;i++){
    int p,y;
    scanf("%d%d",&p,&y);
    a[i]=(node){p,y,-1,i};
  }
  qsort(a,m,sizeof(node),cmpY);
  int *x=(int *)calloc(n+1,sizeof(int));
  for(i=0;i<m;i++){
    int p=a[i].p;
    a[i].x=++x[p];
  }
  qsort(a,m,sizeof(node),cmpIndex);
  for(i=0;i<m;i++){
    print(a[i].p);
    print(a[i].x);
    printf("\n");
  }
}

int main(void){
  run();
  return 0;
}


Measured memory_bytes: 4964
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        FastScanner sc = new FastScanner();
        Strategy strategy = new MyStrategy();
        strategy.solve(out, sc);
        out.flush();
    }
}

class MyStrategy implements Strategy {
    @Override
    public void solve(PrintWriter out, FastScanner sc) {
        String S = sc.next();
        String T = sc.next();
        T = T.substring(0, T.length() -1);
        if (S.equals(T)) {
            out.println("Yes");
        } else  {
            out.println("No");
        }
    }
}

interface Strategy {
    void solve(PrintWriter out, FastScanner sc);
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


Measured memory_bytes: 25492
h, w = map(int, input().split())
s = [input() + '#' for _ in range(h)]
s.append('#' * w)

yoko = [[0] * w for _ in range(h)]
for i in range(h):
  si = s[i]
  if si[0] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, w + 1):
    if si[j] == '#':
      if start != -1:
        for k in range(start, j):
          yoko[i][k] = j - start
        start = -1
    else:
      if start == -1:
        start = j

tate = [[0] * w for _ in range(h)]
for i in range(w):
  if s[0][i] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, h + 1):
    if s[j][i] == '#':
      if start != -1:
        for k in range(start, j):
          tate[k][i] = j - start
        start = -1
    else:
      if start == -1:
        start = j

result = 0
for i in range(h):
  yokoi = yoko[i]
  tatei = tate[i]
  for j in range(w):
    t = yokoi[j] + tatei[j] - 1
    if t > result:
      result = t

print(result)


Measured memory_bytes: 129496
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
T[] RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[][] RDA2(T = long)(size_t n, T[] fix = []) { auto r = new T[][](n); foreach (i; 0..n) { r[i] = readln.chomp.split.to!(T[]); foreach (j, e; fix) r[i][j] += e; } return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto M = RD;
	auto D = RD;

	long ans;
	foreach (i; 0..M)
	{
		foreach (j; 0..D)
		{
			auto d1 = (j+1) % 10;
			auto d10 = (j+1) / 10;
			if (d1 >= 2 && d10 >= 2 && d1*d10 == i+1)
			{
				++ans;
			}
		}
	}

	writeln(ans);
	stdout.flush();
	debug readln();
}

Measured memory_bytes: 256
#pragma comment(linker, "/STACK:102400000,102400000")
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <map> 
#include <set>
#include <ctime> 
#include <queue> 

#define LL long long

using namespace std;

const int N = 200000+10;

int n;
int a[N]; 
LL sum=0;

int main()
{

	scanf("%d", &n);
	for(int i = 1; i <= n; i++)
		scanf("%d", &a[i]),
		sum+=a[i];
	LL cur = a[1], ans = abs(a[1]-(sum-a[1]));
	for(int i = 2; i < n; i++)
		cur += a[i],
		ans = min(ans, abs(sum-cur-cur));
	cout<<ans<<endl;
}

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

#define rep(i, n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i, s, n) for(long long i=(s);i<(long long)(n);i++)
#define repi(i, n) for(int i=0;i<(int)(n);i++)
#define rep2i(i, s, n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(), v.end()

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

const ll INF = (1LL<<60);
const int INFi = (1<<29);

int main(){

    ll n; cin >> n;

    switch(n%10){
        case 0: cout << "pon" << endl; break;
        case 1: cout << "pon" << endl; break;
        case 2: cout << "hon" << endl; break;
        case 3: cout << "bon" << endl; break;
        case 4: cout << "hon" << endl; break;
        case 5: cout << "hon" << endl; break;
        case 6: cout << "pon" << endl; break;
        case 7: cout << "hon" << endl; break;
        case 8: cout << "pon" << endl; break;
        case 9: cout << "hon" << endl; break;
    }

    return 0;
}

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

string str;
int res = 0;

void solve() {
	for (int i = 0; i < str.size(); i++) {
		if (str[i] != str[str.size()-1-i]) {
			return;
		}
	}
	res++;
}

int main(int argc, const char *argv[]) {
	while (cin>>str) {
		solve();
	}
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 0
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

X = input()

cnt = 0
s = 0

for i in range(len(X)):
	if X[i] == "S":
		s += 1
	else:
		if 0 < s:
			cnt += 1
			s -= 1

print(len(X)-2*cnt)

Measured memory_bytes: 10564
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr LL INF = 1000000000000;
constexpr int MOD = 1'000'000'007;

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n,W;
    cin >> n >> W;
    VLL w(n), v(n);
    REP(i,0,n) cin >> w[i] >> v[i];
    VVLL dp(n, VLL(1000*n+1, INF));
    dp[0][0] = 0;
    dp[0][v[0]] = w[0];
    REP(i,1,n) REP(j,0,1000*n+1) {
        dp[i][j] = dp[i-1][j];
        if (j - v[i] >= 0) {
            dp[i][j] = min(dp[i][j], dp[i-1][j-v[i]] + w[i]);
        }        
    }
    RREP(i,0,1000*n+1) if (dp[n-1][i] <= (LL)W) {
        cout << i << endl;
        return;
    }
}

int main() {
    solve();
    
    return 0;
}

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

int main(){
  int X,A,B;
  cin>>X>>A>>B;
  
  if(B-A>X){
    cout<<"dangerous"<<endl;
  }
  else if(B>A &&B-A<=X){
    cout<<"safe"<<endl;
  }
  else{
    cout<<"delicious"<<endl;
  }
}
    


Measured memory_bytes: 256
import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
 
    label:
    while(sc.hasNextLine()){
      int h = sc.nextInt();
      int w = sc.nextInt();
       
      if(h==0 && w==0) break label;
      for(int j = 1; j<=h; j++){
        for(int i = 1; i<=w; i++){
          if(j == 1 || j == h){
            System.out.print("#");
          }else{
            if(i == 1 || i == w){
              System.out.print("#");
            }else{
              System.out.print(".");
            }
          }
        }
        System.out.println("");
      }
        System.out.println("");
    }
     
  }
}


Measured memory_bytes: 33096
#include"bits/stdc++.h"

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;
typedef priority_queue<VL> PQ_DESC_VL;
typedef priority_queue<VL, vector<VL>, greater<VL>> PQ_ASC_VL;
typedef priority_queue<PLL> PQ_DESC_PLL;
typedef priority_queue<PLL, vector<PLL>, greater<PLL>> PQ_ASC_PLL;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
//#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SORT_DESC(c) sort((c).rbegin(),(c).rend())
#define REV(c) reverse((c).begin(), (c).end())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF*(LL)INF;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

void Main()
{
    string s;cin>>s;
    REP(i,3){
        cout<<s[i];
    }
    cout<<endl;
    
	return;
}

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

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

int main() {
  int64_t N,K, count;
  cin >> N >> K;
  count = 0;
  vector<int> data(N);
  for (int i=0; i<N; i++){
    cin >> data.at(i);
  }
  sort(data.begin(), data.end());
  reverse(data.begin(), data.end());
  for(int i = K; i< N; i++){
    count += data.at(i);
  }
  cout << count << endl;
  
}


Measured memory_bytes: 1024
#include<stdio.h>
#define N 200000
int main(){

  int i,j,n;
  int data[N];
  int res,max_i;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&data[i]);
  }

  max_i=1;
  for(i=2;i<n;i++){
    if(data[max_i]<data[i]){
      max_i=i;
    }
  }
  res=data[1]-data[0];
  for(i=0;i<n-1;i++){
    if(max_i==i){
      max_i++;
      for(j=i+1;j<n;j++){
	if(data[max_i]<data[j]){
	  max_i=j;
	}
      }
      if(res<data[max_i]-data[i]){
	res=data[max_i]-data[i];
      }
    }
    else{ 
      if(res<data[max_i]-data[i]){
	res=data[max_i]-data[i];
      }
    }
  }
  printf("%d\n",res);
  return 0;
}
  



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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;
template <class T> using vec = vector<T>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> T(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &T[i]);
  }

  ll ans = 1;
  rep(i, 0, sz(T)) { ans = lcm(ans, T[i]); }
  put(ll(ans));
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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;
}

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) {
  T c = min(a, b), d = max(a, b);
  return c * (d / gcd(c, d));
}

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


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

using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;

int N;
Graph G;

vector<int> res;

void dfs(int v, int p, int c){
    res[v] = c;
    for(auto e : G[v]){
        if(e.first == p) continue;
        if(e.second & 1) dfs(e.first, v, 1-c);
        else dfs(e.first, v, c);
    }
}

int main(){
    cin >> N;
    G.assign(N, vector<Edge>());
    for(int i = 0; i < N - 1; i++){
        int u, v, w; cin >> u >> v >> w;
        u--; v--;
        G[u].push_back(Edge(v, w));
        G[v].push_back(Edge(u, w));
    }
    res.assign(N, 0);
    dfs(0, -1, 1);
    for(auto v : res) cout << v << endl;
}

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

///    ____ ____ ____ ____ ____
///   ||a |||t |||o |||d |||o ||
///   ||__|||__|||__|||__|||__||
///   |/__\|/__\|/__\|/__\|/__\|
///

using namespace std;

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

int n, k;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> k;
    int g = 0;
    int mi = INT_MAX, mx = INT_MIN;
    for(int i = 1; i <= n; i++)
    {
        int val;
        cin >> val;
        g = gcd(g, val);
        mi = min(mi, val);
        mx = max(mx, val);
    }
    if(k % g == 0 && mi <= k && k <= mx)
        cout << "POSSIBLE\n";
    else
        cout << "IMPOSSIBLE\n";
    return 0;
}


Measured memory_bytes: 3660
#include <iostream>
#include <string.h>
using namespace std;

int main(int argc, char *argv[]){
    long long d;
    int n;
    cin >> n >> d;
    d=d*d;
    long long x,y;
    int c=0;
    for(int i=0;i<n;i++){
        cin >> x >> y;
        if(x*x+y*y<=d) c++;
    }
    cout << c << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

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

    int sum = 0;
    for (int i = 0; i < N; i++) sum += L[i];

    int max_val = *max_element(L.begin(), L.end());

    if (max_val < sum - max_val) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <numeric>
#include <iostream>

using namespace std;

#define FOR(i, a, b)   for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)  for(int i = (a); i > (b); --i)
#define rep(i, n)      for(int i = 0; i < (n); ++i)
#define all(c)         begin(c), end(c)
#define rall(c)        rbegin(c), rend(c)
#define SZ(a)          ((ll) a.size())

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

int main() {
	int a,b;
	cin >> a >> b;
	if(a+b==15)cout << "+";
	else if(a*b==15)cout << "*";
	else cout << "x";
	return 0;
}


Measured memory_bytes: 256