akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int dfs(map<int, int>::iterator it, vector<int> &times, map<int, int> &d) {
    if (it == d.end()) {
        int mindiff = 25;
        int nt = times.size();
        for (int i = 0; i < nt; ++i) {
            for (int j = 0; j < nt; ++j) {
                if (i == j)
                    continue;
                chmin(mindiff, abs(times[i] - times[j]));
                chmin(mindiff, 24 - abs(times[i] - times[j]));
            }
        }
        return mindiff;
    }
    int ret = 0;
    if (it->second == 1) {
        auto ntimes = times;
        ntimes.push_back(it->first);
        chmax(ret, dfs(next(it), ntimes, d));
        ntimes = times;
        ntimes.push_back(24 - it->first);
        chmax(ret, dfs(next(it), ntimes, d));
    }
    if (it->second == 2) {
        auto ntimes = times;
        ntimes.push_back(it->first);
        ntimes.push_back(24 - it->first);
        chmax(ret, dfs(next(it), ntimes, d));
    }
    return ret;
}

int main() {
    int n;
    cin >> n;
    map<int, int> d;
    bool zero = false;
    for (int i = 0; i < n; ++i) {
        int dd;
        cin >> dd;
        d[dd]++;
        if (d[dd] == 3)
            zero = true;
    }
    if (zero) {
        cout << 0 << "\n";
        return 0;
    }
    vector<int> times = {0};
    cout << dfs(d.begin(), times, d) << "\n";

    return 0;
}


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

int main(){
	// sengen
	int n;
	// nyuryoku
	cin >> n;
	// keisan
	int count = 0;
	if(n > 9){
		count += 9;
	}else{
		count += n;
	}
	if(n > 999){
		count += 900;
	}else{
		if(n > 99){
			count += n - 100 + 1;
		}
	}
	if(n > 99999){
		count += 90000;
	}else{
		if(n > 9999){
			count += n - 9999;
		}
	}
	// syutsuryoku
	cout << count << endl;
}


Measured memory_bytes: 3612
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001

int main() {
    int N; cin >> N;
    if(N%2){
        cout << fixed << setprecision(20) << (double)((N + 1) / 2 )/ N << endl;
    }else{
        cout << fixed << setprecision(20) << (double)(N/2) / N << endl;
    }
    
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>

using namespace std;

int n,a,b,c;
int main()
{
    cin>>n;
	while(n--)
	{
		cin>>a>>b>>c;
		if(a<b+c || (a&1)!=(b+c&1))
		{
			puts("No");
			return 0;
		}
	}
	puts("Yes");
}

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

typedef pair<int, int> P;
const int N = 2e5;
const int INF = 1e18;

struct edge{ int to,cost; };
vector< edge > G[N];

signed main(){

  int n,m; cin >> n >> m;
  for(int i = 0; i < m; i++){
    int L,R,D; cin >> L >> R >> D;
    G[L].push_back({R,D});
    G[R].push_back({L,-D});
  }

  int d[N];
  fill(d,d+N,INF);
  queue<int> que;
  for(int i = 0; i < N; i++){
    if(G[i].empty() || d[i] < INF) continue;
    d[i] = 0; //基準にして考える
    que.push(i);
    while(!que.empty()){
      int from = que.front();
      for(int j = 0; j < G[from].size(); j++){
        int to = G[from][j].to;
        int cost = G[from][j].cost;
        if(d[to] < INF){
          if(d[to] != d[from] + cost){
            cout << "No" << endl;
            return 0;
          }
        }
        else {
          d[to] = d[from] + cost;
          que.push(to);
        }
      }
      que.pop();
    }
  }
  cout << "Yes" << endl;

  return 0;
}


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

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

  for (int i = 0; i < 1000; i++)
  {
    int N = K;
    N *= i;
    if (a <= N && N <= b)
    {
      cout << "OK" << endl;
      break;
    }
    else if (N >= b)
    {
      cout << "NG" << endl;
      break;
    }
  }
}

Measured memory_bytes: 3652
#include <iostream>
using namespace std;
int main()
{
    int a,b,i,s1,s2;cin>>a>>b;
    string x,y;
    x="";
    y="";
    s1=0;
    s2=0;
    for(i=0;i<b;i++){
        x+=char(a%10+48);
        s1+=1;
    }
    for(i=0;i<a;i++){
        y+=char(b%10+48);
        s2+=1;
    }
    if(s1>s2){
            cout<<x;
                return 0;

    }
    cout<<y;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<stdlib.h>
#include<iostream>
#include<queue>
using namespace std;
 
priority_queue<int>QD;
priority_queue<int,vector<int>,greater<int> >QU;
 
typedef long long ll;
int n;
int a[310000];
ll pmx[310000],qmn[310000],smx,smn,ans=-(1ll<<60);
 
int main(){
    scanf("%d",&n);
    for(int i=1;i<=3*n;i++){
        scanf("%d",&a[i]);
    }for(int i=1;i<=n;i++){
        smx+=a[i];
        QU.push(a[i]);
    }
    pmx[n]=smx;
    for(int i=n+1;i<=2*n;i++){
        if(a[i]>QU.top()){
            smx-=QU.top();
            QU.pop();
            smx+=a[i];
            QU.push(a[i]);
        }
        pmx[i]=smx;
    }
    for(int i=3*n;i>2*n;i--){
        smn+=a[i];
        QD.push(a[i]);
    }
    qmn[2*n+1]=smn;
    for(int i=2*n;i>=n;i--){
        if(a[i]<QD.top()){
            smn-=QD.top();
            QD.pop();
            smn+=a[i];
            QD.push(a[i]);
        }
        qmn[i]=smn;
    }
    for(int i=n;i<=2*n;i++){
        ans=max(ans,pmx[i]-qmn[i+1]);
    }
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 5112
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    string s,t;
    cin >> s >> t;
    int n = s.size();
    vector<char> v(26,'?');
    rep(i,n) {
        char ns = s[i];
        char nt = t[i];
        if(v[ns-'a'] == '?') {
            rep(j,26) if(v[j] == nt) {
                    cout << "No" <<  endl;
                    return 0;
                }
            v[ns-'a'] = nt;
        } else {
            if(v[ns-'a'] != nt) {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 776
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int ans=0;
int a[10][3];
void dfs(int n,int depth,int seki){
  if(n==depth){
    if(seki==1)
      ans++;
    return;
  }
  for(int i=0;i<3;i++){
    int ss=seki;
    //cout<<ss<<endl;
    if(a[depth][i]%2==0){
      ss=1;
     
    }
    //cout<<a[depth][i]<<endl;
    //cout<<ss<<" "<<depth<<endl;
    dfs(n,depth+1,ss);
  }
}
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i][1];
    a[i][0]=a[i][1]+1;
    a[i][2]=a[i][1]-1;
  }
  dfs(n,0,0);
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int count=0;
  int a,b;
  for(int i=0;i<n;i++){
    cin>>a>>b;
    if(a==b){
      count++;
      if(count==3){
        cout<<"Yes"<<endl;
        return 0;
      }
    }else{
      count=0;
    }
  }
  cout<<"No"<<endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
vector<vector<long long int>> g;
long long int n,m;
long long int dp[100001];
long long int visited[100001];
void dfs(long long int s)
{
	visited[s]=1;
	for(auto it:g[s])
		if(!visited[it])
			dfs(it);
	for(auto it:g[s])
		dp[s]=max(dp[s],dp[it]+1);
}
int main()
{   
   scanf("%lld%lld",&n,&m);
   long long int u,v,i,ans;
   g.resize(n+1);
   for(i=0;i<m;i++)
   {
   	scanf("%lld%lld",&u,&v);
   	g[u].push_back(v);
   }
   for(i=1;i<=n;i++)
   	if(!visited[i])
   		dfs(i);
   ans=0;
   for(i=1;i<=n;i++)
   	ans=max(ans,dp[i]);
   printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 9344
#include <vector>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <math.h>
#include <list>

using namespace std;

int sum_digit(int n) {
	if (n == 0) return 0;
	else return n % 10 + sum_digit(n / 10);
}
int absolute(int a) {
	if (a < 0) return -a;
	else return a;
}

int main()
{
  long long N,M; cin >> N >> M;
  
  long long ans;
  if( N == 1 && M == 1) ans = 1;
  else if( N == 1 ) ans = N * (M - 2);
  else if( M == 1 ) ans = M * (N - 2);  
  else ans = (N - 2) * (M - 2);
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define pi pair<int,int>
#define pl pair<long long,long long>
#define lg length()
#define pb push_back
ifstream in("file.in");
ofstream out("file.out");
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005

int n,a[100005],x,y,ans,v[100005];

vector <int> g[100005];

void DFS(int nod){
    a[nod]=1; v[nod]=1;
    int add=0;
    for(int i : g[nod]){
        if(v[i]) continue;
        DFS(i);
        add^=a[i];
    }
    a[nod]+=add;
}

int32_t main(){
    ios_base :: sync_with_stdio(0);
    cin >> n;
    for(int i=1;i<n;i++){
        cin >> x >> y;
        g[x].pb(y);
        g[y].pb(x);
    }
    DFS(1);
    for(int i : g[1]) ans^=a[i];
    if(ans) cout << "Alice";
    else cout << "Bob";
}


Measured memory_bytes: 11264
#include<iostream>
using namespace std;
int main(){
int N;
  cin>>N;
  double tax=1.08;
  int i;
  for(i=1;i<=N;i++){
  	if((int)(i*tax)==N){
      cout<<i;  
	return 0;
 	}
  }
  cout<<":(";
}

Measured memory_bytes: 3560
// using greedy algorrithm
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<bool> seen_1;
vector<int> depth_1;
vector<bool> seen_2;
vector<int> parent;
vector<int> subTree;
void dfs(int node, bool type) {
  if(!type) {
    if(seen_1[node]) return;
    seen_1[node] = true;
    for(auto& nex : g[node]) {
      if(seen_1[nex]) continue;
      else {
        depth_1[nex] = depth_1[node] + 1;
        parent[nex] = node;
        dfs(nex, type);
      }
    }
  }
  else {
    if(seen_2[node]) return;
    seen_2[node] = true;
    subTree.emplace_back(node);
    for(auto& nex : g[node]) {
      if(seen_2[nex]) continue;
      else dfs(nex, type);
    }
  }
}
int main() {
  int n, u, v;
  cin >> n >> u >> v;
  u--;v--;
  g.resize(n);
  seen_1.resize(n, false);
  depth_1.resize(n, 0);
  seen_2.resize(n, false);
  parent.resize(n, -1);
  for(int i=0;i<n-1;i++) {
    int a, b;
    cin >> a >> b;
    a--;b--;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  dfs(v, 0);
  vector<int> path;
  path.emplace_back(u);
  int now = u;
  while(parent[now] != -1) {
    path.emplace_back(parent[now]);
    now = parent[now];
  }
  int target = path[path.size()/2-1];
  seen_2[parent[target]] = true;
  dfs(target, 1);
  int deepest = 0;
  for(auto& el : subTree) {
    if(depth_1[el] > deepest) deepest = depth_1[el];
  }
  cout << deepest - 1 << endl;
  return 0;
}


Measured memory_bytes: 11200
// atcoder/abc083/B/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n, a, b;
  while (cin >> n >> a >> b) {
    int x = 0;
    for (int i = 1; i <= n; ++i) {
      string s = to_string(i);
      int sum = 0;
      each (c, s) sum += c - '0';
      x += i * (a <= sum && sum <= b);
    }
    cout << x << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>

using namespace std;

int pedras[100100];
int dp[100100]; ///Guardo os valores da funcao frog;

int n,k;
const int inf =1000000/*1e9*/;

int main(){

    memset(dp,inf,sizeof(dp));
    cin >>n>>k;

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

    ///Comeca aki a bagaca
    dp[n-1]=0;

    for(int i=n-2;i>=0;i--){

        ///int menor=inf;

        for(int j=1;j<=k;j++){
            if(i+j<=n-1){
                int cost = abs(pedras[i]-pedras[i+j]);
                dp[i]=min(dp[i],dp[i+j]+cost);
                /*menor = min(menor,dp[i+j]+cost);*/
            }
        }

        ///dp[i]=menor;
    }

    cout<<dp[0];

}


Measured memory_bytes: 4348
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long

int n;
vector <int> a;

ll solve(int l, ll cl, int r, ll cr){
    if(l + 1 == r) return 0;
    ll ret = 1e18;
    for(int k = l + 1 ; k < r ; k++){
        ret = min(ret, solve(l, cl, k, cl + cr) + solve(k, cl + cr, r, cr) + (cl + cr) * a[k]);
    }
    return ret;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    a.resize(n);
    for(auto &i : a) cin >> i;
    cout << solve(0, 1, n - 1, 1) + a[0] + a[n - 1] << endl;
}


Measured memory_bytes: 3704
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>

using namespace std;

#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
static const ll maxLL = (ll) 1 << 62;
const ll MOD = 1000000007, INF = 1e18;

template<typename T1, typename T2>
bool pairCompare(const pair<T1, T2> &firstElof, const pair<T1, T2> &secondElof) {
    return firstElof.second > secondElof.second;
}

int mapMaxValue(std::map<ll, int> m) {
    int max = 0;
    for (std::map<ll, int>::iterator it = m.begin(); it != m.end(); it++) {
        if (max < it->second) max = it->second;
    }
    return max;
}

int main(void) {
    int n;
    cin >> n;
    float p;
    if (n % 2 == 0) {
        p = 1 / 2.0f;
    } else {
        p = (float)(n / 2 + 1) / (float) n;
    }
    cout << p << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define inf 1e9
#define endl '\n'
int j,p,l=0,h=0;
int main()
{ios::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);vector<int>dp(3,0);
 int n;cin>>n;
 for(int i=0;i<n;i++)
 {
     vector<int>c(3);for(int i=0;i<3;i++)cin>>c[i];vector<int>new_dp(3,0);
     for(int j=0;j<3;j++)
     {
         for(int k=0;k<3;k++)
         {
             if(k!=j)
             {
                new_dp[k]=max(new_dp[k],dp[j]+c[k]) ;
             }
         }
     }
     dp=new_dp;
  //   for(int g=0;g<3;g++)cout<<dp[i]<<" ";cout<<endl;
 }
  cout<<max({dp[0],dp[1],dp[2]});
}

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

long modFact(long x, long mod);

int main() {
    const long MOD = 1000000007;
    long n;
    cin >> n;
    cout << modFact(n, MOD) << endl;
}

long modFact(long x, long mod) {
    if(x == 0 || x == 1) return 1;
    return x * modFact(x - 1, mod) % mod; 
}

Measured memory_bytes: 3328
N,K=map(int,input().split())
P=list(map(int,input().split()))
C=list(map(int,input().split()))
a=[]
ans=-10**10
for i in range(N):
    idx=P[i]-1
    z=set()
    rl=[]
    c=0
    tc=0
    while idx not in z and c<K:
        tc+=C[idx]
        rl.append(tc)
        ans=max(ans,tc)
        z.add(idx)
        idx=P[idx]-1
        c+=1
    if c<K:
        d,m=divmod(K,c)
        if m==0:
            d-=1
            m=c
        tc=d*tc
        tc+=max(rl[:m])
        ans=max(ans,tc)
print(ans)

Measured memory_bytes: 168452
#[allow(unused)]
use proconio::{
    input,
    marker::{Chars, Usize1},
};

fn main() {
    input! {
        n: i64,
        k: i64,
    }
    let mut ans = 0.0_f64;
    for i in 1..(n + 1) {
        let mut tmp: i64 = i;
        let mut tmp_ans: f64 = 1.0;
        while tmp < k {
            tmp *= 2;
            tmp_ans /= 2.0;
        }
        ans += tmp_ans;
    }
    println!("{}", ans / n as f64);
}


Measured memory_bytes: 2184
#include<stdio.h>

int main(void){
	int sum1,sum2,a,b,c,d;
	
	scanf("%d%d%d%d",&a,&b,&c,&d);
	
	sum1=a*b;
	sum2=c*d;
	
	if(sum1>=sum2)
				printf("%d",sum1);
	else
				printf("%d",sum2);
	
	







	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll                      long long
#define pb                      push_back
#define rep(i,a,b,c)            for(ll i=(a);i<=(b);i+=(c))
#define repb(i,a,b,c)           for(ll i=(a);i>=(b);i-=(c))
#define MOD                     998244353
#define inf                     3e18
#define ld                      long double
#define mp                      make_pair
#define vpll                    vector<pair<ll,ll> >
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define ln                      cout<<"\n";
#define endl                    "\n"
#define test                    ll T;cin>>T;while(T--)
#define isvowel(a)              (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define show(w,size)            for(ll i=0;i<size;i++) cout<<w[i]<<" ";
#define prll(a)                 cout<<a<<"\n";
#define mset(dp,no)             memset(dp,no,sizeof(dp))
#define input(a,n)              rep(i,0,n-1,1) cin>>a[i];
#define countbit                __builtin_popcount                                           //Number of setbits in decimal notation
#define lb(v,cur)               lower_bound(all(v),cur)-v.begin()
#define ub(v,cur)               upper_bound(all(v),cur)-v.begin()
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
ll pows(ll b,ll e){if(e==0)return 1;else if(e%2==0){ll a=pow(b,e/2);return a*a;}else {ll a=pow(b,e/2);return b*a*a;}}
ll powm(ll x,ll y,ll m=MOD){x=x%m;ll res=1;while(y){if(y&1)res=res*x;res%=m;y=y>>1;x=x*x;x%=m;}return res;}
ll modInverse(ll a, ll m=MOD){if(m == 1)return 0;ll m0=m,y=0,x=1;while(a>1){ll q=a/m,t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0) x+=m0;return x;}
int main()
{
ll n,m,i,j,k,x,y,z,e,f,p,q,g,l,r,w,h,count1=0,prod=1,a,b,c,d,index,x1,x2,diff,ans=0,sum=0,sum1=0,sum2=0,flag=0,flag1=0,flag2=0;
string s,s1,s2;
cin>>s;
if(s[2]==s[3]&&s[4]==s[5])
{
  cout<<"Yes";
}
else
{
  cout<<"No";
}
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int a,b,c;
	scanf("%d %d %d\n",&a,&b,&c);
	
	if(a<b&&b<c)
	{
		printf("Yes\n");
	}
	else
	{
		printf("No\n");
	}
	return 0;
}

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

template<class Abel> struct UnionFind {
    vector<int> par;
    vector<int> rank;
    vector<Abel> diff_weight;

    UnionFind(int n = 1, Abel SUM_UNITY = 0) {
        init(n, SUM_UNITY);
    }

    void init(int n = 1, Abel SUM_UNITY = 0) {
        par.resize(n); rank.resize(n); diff_weight.resize(n);
        for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0, diff_weight[i] = SUM_UNITY;
    }

    //xの根を求める
    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            diff_weight[x] += diff_weight[par[x]];
            return par[x] = r;
        }
    }

    //xの重みを計算する
    Abel weight(int x) {
        root(x);
        return diff_weight[x];
        }

    bool same(int x, int y) {
        return root(x) == root(y);
    }

    //x,yを重みwでマージする
    bool merge(int x, int y, Abel w) {
        w += weight(x); w -= weight(y);
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y), w = -w;
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        diff_weight[y] = w;
        return true;
    }

    //xとyの差を計算する
    Abel diff(int x, int y) {
        return weight(y) - weight(x);
    }
};



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

    ll n,m;
    cin>>n>>m;
    UnionFind<ll> uni(n);
    int l[m],r[m],d[m];
    for(int i=0;i<m;i++){
        cin>>l[i]>>r[i]>>d[i];
        l[i]--,r[i]--;
        uni.merge(l[i],r[i],d[i]);
    }
    bool pos=true;
    for(int i=0;i<m;i++){
        if(uni.diff(l[i],r[i]) != d[i]) pos = false;
    }
    if(pos) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
}


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

using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using f64 = double;
using f80 = long double;

#define FOR(v, a, b) for(i64 v = (a); v < (b); ++v)
#define FORE(v, a, b) for(i64 v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(i64 v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define UNIQ(v) (v).erase(unique(ALL(v)), (v).end())
#define bit(i) (1LL<<(i))

#ifdef DEBUG
#include <Mylib/Debug/debug.cpp>
#else
#define dump(...) ((void)0)
#endif

using namespace std;

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T> void pout(const T &value){std::cout << value << "\n";}
template <typename T, typename ...Args> void pout(const T &value, const Args&... args){std::cout << value << " ";pout(args...);}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}
template <typename T> auto make_vector(int n, int m, const T &value){return vector<vector<T>>(n, vector<T>(m, value));}


struct Init{
  Init(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cerr << fixed << setprecision(12);
  }
}init;



int main(){
  i64 K;
  int N;

  while(cin >> K >> N){
    vector<i64> A(N); cin >> A;

    i64 ans = K;

    i64 m = A[0] + K-A[N-1];
    
    REP(i,N-1){
      chmax(m, abs(A[i] - A[i+1]));
    }

    ans -= m;

    pout(ans);
  }


  return 0;
}


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

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

    int n;
    cin >> n;

    vector<vector<int>> g(n);
    rep(i, n){
        int u, k;
        cin >> u >> k;
        --u;

        rep(j, k){
            int v;
            cin >> v;
            --v;

            g[u].push_back(v);
        }
    }

    queue<int> q;
    vector<int> dist(n, -1);
    q.push(0);
    dist[0] = 0;
    while(!q.empty()){
        int v = q.front();
        q.pop();
        
        for(int nv : g[v]){
            if(dist[nv] != -1) continue;

            dist[nv] = dist[v] + 1;
            q.push(nv);
        }
    }

    rep(i, n) cout << i+1 << " " << dist[i] << endl;

    return 0;
}


Measured memory_bytes: 3156
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <queue>
#include <cstdio>
#include <map>
#include <set>
#include <utility>
#include <stack>
#include <cstring>
#include <cmath>
#include <vector>
#include <ctime>
#include <bitset>
using namespace std;
#define pb push_back
#define sd(n) scanf("%d",&n)
#define sdd(n,m) scanf("%d%d",&n,&m)
#define sddd(n,m,k) scanf("%d%d%d",&n,&m,&k)
#define sld(n) scanf("%lld",&n)
#define sldd(n,m) scanf("%lld%lld",&n,&m)
#define slddd(n,m,k) scanf("%lld%lld%lld",&n,&m,&k)
#define sf(n) scanf("%lf",&n)
#define sff(n,m) scanf("%lf%lf",&n,&m)
#define sfff(n,m,k) scanf("%lf%lf%lf",&n,&m,&k)
#define ss(str) scanf("%s",str)
#define ansn() printf("%d\n",ans)
#define lansn() printf("%lld\n",ans)
#define r0(i,n) for(int i=0;i<(n);++i)
#define r1(i,e) for(int i=1;i<=e;++i)
#define rn(i,e) for(int i=e;i>=1;--i)
#define mst(abc,bca) memset(abc,bca,sizeof abc)
#define lowbit(a) (a&(-a))
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long,long long>
#define mp(aa,bb) make_pair(aa,bb)
#define lrt rt<<1
#define rrt rt<<1|1
#define X first
#define Y second
#define PI (acos(-1.0))
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007 ;
const double eps=1e-9;
const int inf=0x3f3f3f3f;
//const ll infl = 10000000000000000;
const int maxn=  2e5+10;
const int maxm = 2e5+10;
//Pretests passed
int in(int &ret)
{
    char c;
    int sgn ;
    if(c=getchar(),c==EOF)return -1;
    while(c!='-'&&(c<'0'||c>'9'))c=getchar();
    sgn = (c=='-')?-1:1;
    ret = (c=='-')?0:(c-'0');
    while(c=getchar(),c>='0'&&c<='9')ret = ret*10+(c-'0');
    ret *=sgn;
    return 1;
}
int fa[maxn];
int d[maxn];
int faf(int x)
{
    if(fa[x]==x)return x;
    int tmp = faf(fa[x]);
    d[x] += d[fa[x]];
    return fa[x] = tmp;
}
bool ok = 1;
int un(int a,int b,int len)
{
    int f1 = faf(a) , f2 = faf(b);
    if(f1==f2)
    {
        if(d[b]-d[a]!=len)ok = 0;
    }
    else
    {
        fa[f2] = f1;
        d[f2] = -d[b] +len + d[a] ;
    }
}
int main()
{
#ifdef LOCAL
    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
#endif // LOCAL

    int n,m;
    sdd(n,m);
    r1(i,n)fa[i] = i;
    r1(i,m)
    {
        int a,b,c;
        sddd(a,b,c);
        un(a,b,c);
        if(!ok)return 0*puts("No");
    }
    puts("Yes");
    return 0;

}


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

using namespace std;

void solve(){
  string s;
  cin >> s;
  map < int , int > m;
  for(int i = 0; i < 36; i++){
    m[i] = 2;
  }
  for(int i = 0; i < s.size(); i++){
    int t = s[i] - 'a';
    m[t]++;
  }
  int flag = 0;
  for(int i = 0; i < 36; i++){
    if(m[i] % 2 == 1){
      flag = 1;
    }
  }
  if(flag == 0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

int main(){
  solve();
}

Measured memory_bytes: 3596
#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<bits/stdc++.h>
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector> //*max_element(all(変数))で最大値を獲得
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e18
using ll = long long;
using namespace std;
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; }

int main(){
  int n;  cin >> n;
  vi a(n);  rep0(i,n) cin >> a[i];
  int odd = 0, x4 = 0;
  rep0(i,n){
    if(a[i] % 2 == 1) odd++;
    if(a[i] % 4 == 0) x4++;
  }
  int x2 = n-odd-x4;
  if(odd <= x4+1-x2%2) cout << "Yes";
  else cout << "No";
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace abc163_c
{
    class Program
    {
        static void Main(string[] args)
        {
            // 社員数
            int N = int.Parse(Console.ReadLine());

            // 社員番号、社員数の連番に対する同じ数の出現回数を表示
            int[] A = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int[] ans = new int[N];

            //Ai = X なので各数が A に何度出るかを求める。


            //A配列を要素文　社員数-１番目+
            foreach (var item in A)
            {
                ans[item - 1]++;
            }


            foreach (var t in ans)
            {
                Console.WriteLine(t);
            }

            Console.Read();

        }
    }
}


Measured memory_bytes: 43380
#include <bits/stdc++.h>
using namespace std;
int main(){
    
    cin.tie( 0 );
    ios::sync_with_stdio( false );
    
    while(true){
        int n;
        cin >> n;
        
        if(n == 0){ break; }
        vector<int> vc(n);
        
        for(int i=0; i<n; i++){
            cin >> vc[i];
        }
        sort(vc.begin(), vc.end());
        auto res = (accumulate(vc.begin() + 1, vc.end() -1, 0));
        cout << res / (n-2) << endl;
    }
    return 0;
}

Measured memory_bytes: 3012
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
	public static class SegTree{
		int n;
		int[] dat;
		int[] top;

		public SegTree(int n_) {
			int n = 1;
			while(n < n_){
				n *= 2;
			}
			
			this.n = n;
			dat = new int[this.n * 2 - 1];
			top = new int[this.n * 2 - 1];
			for(int i = 0; i < this.n * 2 - 1 ; i++){
				dat[i] = 0;
				top[i] = 0;
			}
		}
		
		public void update_add(int k, int a){
			k += n - 1;
			dat[k] += a;
			top[k] = k - n + 1;
			
			while(k > 0){
				k = (k - 1) / 2;
				
				if(dat[k * 2 + 1] >= dat[k * 2 + 2]){
					dat[k] = dat[k * 2 + 1];
					top[k] = top[k * 2 + 1];
				}else{
					dat[k] = dat[k * 2 + 2];
					top[k] = top[k * 2 + 2];  
				}
			}
		}
		
		public int getMax(){
			return dat[0];
		}
		
		public int getTop(){
			return top[0];
		}
		
		public int size(){
			return n;
		}
		
		public String toString(){
			return Arrays.toString(dat).replaceAll("" + Long.MIN_VALUE, "-oo");
		}
		
	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		final int q = sc.nextInt();
		
		SegTree seg = new SegTree(n);
		
		for(int i = 0; i < q; i++){
			final int a = sc.nextInt() - 1;
			final int v = sc.nextInt();
			
			seg.update_add(a, v);
			System.out.println((seg.getTop() + 1) + " " + seg.getMax());
		}
	}
	
	public static class Scanner {
		
		private BufferedReader br;
		private StringTokenizer tok;
		
		public Scanner(InputStream is) throws IOException{
			br = new BufferedReader(new InputStreamReader(is));
			getLine();
		}
		
		private void getLine() throws IOException{
			tok = new StringTokenizer(br.readLine());
		}
		
		private boolean hasNext(){
			return tok.hasMoreTokens();
		}
		
		public int nextInt() throws IOException{
			if(hasNext()){
				return Integer.parseInt(tok.nextToken());
			}else{
				getLine();
				return Integer.parseInt(tok.nextToken());
			}
		}
		
		public long nextLong() throws IOException{
			if(hasNext()){
				return Long.parseLong(tok.nextToken());
			}else{
				getLine();
				return Long.parseLong(tok.nextToken());
			}
		}
		
		public double nextDouble() throws IOException{
			if(hasNext()){
				return Double.parseDouble(tok.nextToken());
			}else{
				getLine();
				return Double.parseDouble(tok.nextToken());
			}
		}
	}
}

Measured memory_bytes: 84400
#include <bits/stdc++.h>
using namespace std;
//#define MOD 1000000007
#define MOD 998244353
#define INF 1145141919810893364
//#define INF 810114514
#define PI 3.141592653589
typedef long long ll;
typedef pair<ll,ll> PP;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << "0" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl
#define debug false
#define debug2 false




signed main(void){
    int K;
    string S;
    cin >>K >> S;
    if(S.size()<=K){
        cout << S << endl;
    }else{
        REP(i,K){
            cout << S[i];
        }
        cout << "..." << endl;
    }
    return 0;
}




Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <map>
#define ll long long
#define REP(i, x) for(int (i) = 0; (i) < (x); (i) ++)
#define pi 3.1415926535
const int MOD = 1000000007;
using namespace std;

bool prime(int n) {
	for (int i = n - 1; i > 1; i--) {
		if (n%i == 0) {
			return false;
		}
	}
	return true;
}

int main() {
	int n;
	cin >> n;
	ll ans = 1;
	for (int i = 2; i <= n; i++) {
		int count = 1;
		bool flag = prime(i);
		if (!flag) {
			continue;
		}
		else {
			for (int j = 2; j <= n; j++) {
				if (j%i == 0) {
					int k = j;
					while (k%i == 0) {
						count++;
						k /= i;
					}
				}
			}
		}
		ans *= count;
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
const int MAX_N = 110;
struct Card {
	char suit, value;
};

int i, j, minj, n, cnt, k, f;
Card x, a[MAX_N];
void bubbleSort(struct Card A[], int N) {
	for (i = 0; i < N; ++i) {
		for (j = N - 1; j >= i + 1; --j) {
			if (A[j].value < A[j - 1].value) {
				Card x = A[j];
				A[j] = A[j - 1];
				A[j - 1] = x;
			}
		}
	}

}
void selectionSort(struct Card A[], int N) {
	for (i = 0; i < N; ++i) {
		minj = i;
		for (j = i; j < N; ++j) {
			if (A[j].value < A[minj].value) {
				minj = j;
			}
		}

		Card x = A[i];
		A[i] = A[minj];
		A[minj] = x;

	}

}
void print(struct Card A[], int N) {
	for (i = 0; i < N; i++) {
		if (i > 0)
			cout << " ";
		cout << A[i].suit << A[i].value;
	}
	cout << endl;
}
bool hikaku(struct Card C1[], struct Card C2[], int N) {
	for (i = 0; i < N; ++i) {
		if (C1[i].suit != C2[i].suit)
			return false;
	}
	return true;
}

int main() {
	Card C1[MAX_N], C2[MAX_N];
	int N;
	char ch;
	cin >> N;
	for (j = 0; j < N; ++j) {
		cin >> C1[j].suit >> C1[j].value;
	}
	for (i = 0; i < N; ++i) {
		C2[i] = C1[i];
	}

	bubbleSort(C1, N);
	selectionSort(C2, N);

	print(C1, N);
	cout << "Stable" << endl;
	print(C2, N);
	if (hikaku(C1, C2, N) == true)
		cout << "Stable" << endl;
	else
		cout << "Not stable" << endl;

	return 0;
}

Measured memory_bytes: 3100
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N;
  cin >> N;
  vl A(N);
  ll sum = 0;
  REP(i, N) {
    cin >> A[i];
    sum += A[i];
  }
  if (sum % (((N + 1) * N) / 2) != 0) {
    cout << "NO" << endl;
    return 0;
  }
  ll C = sum / (((N + 1) * N) / 2);
  bool po = true;
  if (A[0] - A[N - 1] - C > 0 || -(A[0] - A[N - 1] - C) % N != 0) {
    po = false;
  }
  REP(i, N - 1) {
    if (A[i + 1] - A[i] - C > 0 || -(A[i + 1] - A[i] - C) % N != 0) {
      po = false;
    }
  }
  if (po) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


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

int main(void){
    int r,c,i,j,a[200][200]={{0}};
    // int sum=0;
    cin >> r >> c;
  
    for(i = 1; i <= r; i++){
        for(j = 1; j <= c; j++) {
            cin >> a[i][j];
        }
    }
    for(i = 1; i <= r+1; i++) {
        int csum = 0;
        for(j = 1; j <= c; j++) {
            csum += a[i][j];
        }
        a[i][c+1] = csum;
    }
    for(j = 1; j <= c+1; j++){
        int rsum = 0;
        for(i = 1; i <= r; i++){
            rsum += a[i][j];
        }
        a[r+1][j] = rsum;
    }
    
    for(i = 1; i <= r+1; i++) {
        for(j = 1; j <= c; j++) {
            cout << a[i][j] << " ";
        }
            cout << a[i][c+1] << endl;
    }
}


Measured memory_bytes: 3228
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int s=Integer.parseInt(sc.next());
int h=s/(3600);
int m=(s-3600*h)/60;
s=s-3600*h-60*m;
System.out.println(h+":"+m+":"+s);
}
}


Measured memory_bytes: 26276
#include <bits/stdc++.h>
#define LL long long

int n, k;
long long ans; 

int main()
{
	scanf("%d%d", &n, &k);
	for(int i=k+1; i<=n; i++)
	{
		ans+=((i-k)*(n/i));
		for(int j=k; j<=n%i; j++) ans++;
	}
	if(k==0) ans-=n;
	printf("%lld\n", ans);
}

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

int main(){
	int n, amax, amax_s, t;
	cin >> n;
	vector<int> a(n);
	amax = 0;
	amax_s = 0;

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

	for(int i=0; i<n; i++){
		t = a[i];
		if(amax < t){
			amax = t;
			continue;
		}else if(amax_s < t){
			amax_s = t;
			continue;
		}
	}

	for(int i=0; i<n; i++){
		t = a[i];
		if(t == amax){
			cout << amax_s << endl;
			continue;
		}else{
			cout << amax << endl;
			continue;
		}
	}
	return 0;
}



Measured memory_bytes: 2432
import java.util.Arrays;
import java.util.Scanner;

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

        int N = scan.nextInt();
        long num[] = new long[N];
        long ans = 1, limit = 1000000000000000000L;
		for(int i = 0; i < N; i++){
			num[i] = scan.nextLong();
		}

		Arrays.sort(num);
		for(Long tmp: num) {
			if(tmp == 0) {
				ans = 0;
				break;
			}else if(tmp <= (limit / ans)){
				ans *= tmp;
			}else {
				ans = -1;
				break;
			}
		}

		System.out.println(ans);
	}
}


Measured memory_bytes: 61188
X, N = map(int, input().split())
if N == 0:
  print(X)
else:
  nums = list(map(int, input().split()))
  existed = [0 for _ in range(102)]
  for num in nums:
    existed[num] = 1
  for d in range(101):
    if 0 <= X-d <= 101 and existed[X-d] == 0:
      print(X-d)
      exit()
    if 0 <= X+d <= 101 and existed[X+d] == 0:
      print(X+d)
      exit()

Measured memory_bytes: 61900
#include<bits/stdc++.h>
using namespace std;
int main(){
	 unsigned int a,b;
	char op;
	scanf("%u %c %u",&a,&op,&b);
	if(op=='+'){
		printf("%u",a+b);
		
	}
	else if(op=='-'){
		printf("%d",a-b);
	}
	
	
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define ll long long
const ll mod = 1e9+7;

int main(void)
{
    ll n, ans=0;
    cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    ll sum = accumulate(a.begin(), a.end(), 0LL);
    rep(i,n){
        sum -= a[i];
        ans += ( (a[i]%mod) * (sum%mod) ) % mod;
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4752
#include<bits/stdc++.h>
#define N 55
#define SIZE 2000005
#define int long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(),v.end()
using namespace std;
int a,b,n;
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>a>>b>>n;
    int ans = a*(min(b-1ll,n));
    ans /= b;
    cout<<ans;
    return 0;
}

Measured memory_bytes: 3648
#include<stdio.h>
int main(void)
{
  int month,day;
  char str[8];
  
  fgets(str,sizeof(str),stdin);
  sscanf(str,"%d%d",&month,&day);
  
  if(day >= month)
  {
    printf("%d",month);
  }else
  {
    printf("%d",month-1);
  }
  
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
using namespace std;
int count;
string A="abcdefgqrstvwxz";
string X;

int sA(char ch){
  int g=0;
  for(int i=0;i<A.size();i++){
    if(ch==A[i]){
      g=1;
      break;
  }
  }
  return g;
}
int main(){
  while(1){
    count=0;
    cin >> X;
    if(X[0]=='#')break;
    for(int i=0;i<X.size();i++){

      if(sA(X[i])==1 && i<X.size()-1){
	if(sA(X[i+1])!=1){
	  count++;
	}
      }else{
      if(sA(X[i+1])){
	  count++;
	}
      }
    }
    cout << count << endl;
  }
}

Measured memory_bytes: 1188
#include <iostream>
#include <iomanip>
#include <cmath>
#include <functional>
#include <algorithm>
#include <numeric>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <boost/range/irange.hpp>
#include <boost/container/static_vector.hpp>
#include <boost/utility/string_ref.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/math/common_factor_rt.hpp>

template <class... Args>
struct tuple_input_impl;
template <std::size_t i, std::size_t... tail>
struct tuple_input_impl<std::index_sequence<i, tail...>>
{
    template <class... Args>
    static void f(std::tuple<Args...>& x)
    {
        std::cin >> std::get<i>(x);
        tuple_input_impl<std::index_sequence<tail...>>::f(x);
    }
};
template <>
struct tuple_input_impl<std::index_sequence<>>
{
    static void f(...) {}
};

template <class... Args>
std::istream& operator>>(std::istream& in, std::tuple<Args...>& x)
{
    tuple_input_impl<std::index_sequence_for<Args...>>::f(x);
    return in;
}

template <class T>
T read()
{
    T res;
    std::cin >> res;
    return res;
}
template <class T>
std::vector<T> read(std::size_t n)
{
    std::vector<T> res(n);
    for (std::size_t i = 0; i < n; ++i) std::cin >> res[i];
    return res;
}

template <class T>
void out_impl(T&& v) { std::cout << std::forward<T>(v); }
template <class T, class... Args>
void out_impl(T&& v, Args&&... args)
{
    std::cout << std::forward<T>(v) << ' ';
    out_impl(std::forward<Args>(args)...);
}
template <class... Args>
void out(Args&&... args)
{
    out_impl(std::forward<Args>(args)...);
    std::cout << '\n';
}
template <class... Args>
void out_noreturn(Args&&... args) { out_impl(std::forward<Args>(args)...); }

template <class T>
void print(const T& container)
{
    bool first = true;
    for (auto&& x : container) {
        if (!first) std::cout << ' ';
        std::cout << x;
        first = false;
    }
    std::cout << '\n';
}

void prog()
{
    int a, b, c;
    std::cin >> a >> b >> c;
    out(std::min(c, b / a));
}

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


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int N, K, P; //　K…石の個数　P…人数
    cin >> N;
    for(int i=0; i<N; i++){
        cin >> K >> P;
        if(K % P != 0){
            cout << K % P << endl;
        }
        else cout << P << endl;
    }
    return 0;
}

/*
　石の数を人数で割り，余った最後の石を取った人が勝ちとなります。
　割り切れるとき，誰が勝つのかに気を付けましょう。
*/


Measured memory_bytes: 3080
n=int(input())
a=list(map(int,input().split()))
bignam= -1000001
smolnam=10000001
total=0
for x in a:
    if bignam<x:
        bignam=x
    if smolnam>x:
        smolnam=x
    total+=x
print(smolnam,bignam,total)    



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

char in[2];

int main() {
    scanf("%s", in);
    in[0]++;
    printf("%s\n", in);
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
using namespace std;
#include <bits/stdc++.h>
#include<utility>
#include <algorithm>
#include<iterator>
#define  go return 0
#define pb push_back
#define lp(j, n)  for(int j=0; j<(int)(n); ++j)
#define rep(i,n) for(int i=0;i<n;++i)
#define all(v)   ((v).begin()), ((v).end())
#define sz(v)    ( (int)((v).size()) )
#define F first
#define S second
typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pair<int,string> > vpii;
typedef map<int, int> mii;
const ll N=1e5+5;
ll arr[N],A[N]  ;
bool visited[N]={} , cnt[N]={};
bool f;
int main()
{

  ll n,sol=0;
  cin>>n;
  rep(i,n&&cin>>arr[i]);
  rep(i,n)
  {
      lp(j,n)
      {
          if(abs(arr[i]-arr[j]) > sol )
          {
              sol=abs(arr[i]-arr[j]) ;
          }
      }
  }
cout<<sol;
 go;
}


Measured memory_bytes: 256