akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define INIT std::cin.tie(0);std::ios::sync_with_stdio(false);
#define ALL(c) (c).begin(), (c).end()
#define CALL(c) (c).cbegin(), (c).cend()
#define RALL(c) (c).rbegin(), (c).rend()
#define CRALL(c) (c).crbegin(), (c).crend()
#define REP(i, n) for (int i = 0; i < static_cast<int>(n); i++)
#define FOR(i, s, n) for (int i = s; i < static_cast<int>(n); i++)
#define ASC(t) [](t& x, t& y){ return x < y; }
#define DESC(t) [](t& x, t& y){ return x > y; }
#define PSORT(s,p,e) partial_sort((s), next((s), (p)), (e))
#define VIEW(v,t) for_each((v).begin(), (v).end(), [](t& a) { cout << a << " "; }); cout << endl;

#define IN(a, x, b) (a<=x && x<b)
template<class T> inline T CHMAX(T& x, const T y){return x=(x<y)?y:x;}
template<class T> inline T CHMIN(T& x, const T y){return x=(x>y)?y:x;}
#define OUT(dist) std::cout<<(dist);
#define WS std::cout<<" ";
#define NL std::cout<<"\n"

using PII = pair<int, int>;
using PLL = pair<long long, long long>;
using LL = long long;
using ULL = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using V2 = vector<vector<T>>;
template<class T, int W=255> using A = array<T, W>;
template<class T, int W=255, int H=255> using A2 = array<array<T, W>, W>;

int x,y;

int main(){
    INIT;
    cin >> x >> y;
    cout << x + (y/2) << "\n";
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int H,W,total=0,maxm=0;
string str;
char t[1010][1010];
char u[2][2];
char v[]={'J','O','I'};
int check(int y,int x){
  if(t[y][x]==u[0][0]&&
     t[y+1][x]==u[1][0]&&
     t[y][x+1]==u[0][1]&&
     t[y+1][x+1]==u[1][1])
    return 1;
  return 0;
}
 
int main(){
  for(int i=0;i<1010;i++)
    for(int j=00;j<1010;j++)
      t[i][j]='*';
  cin>>H>>W;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      cin>>t[i][j];
    }
  }
  for(int i=0;i<2;i++)for(int j=0;j<2;j++)cin>>u[i][j];
 
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      total+=check(i,j);
    }
  }
 
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
  
      int a = check(i-1,j-1)+check(i,j)
    +check(i-1,j)+check(i,j-1);
      char tmp=t[i][j];
      for(int k=0;k<3;k++){
    t[i][j]=v[k];
    int b = check(i-1,j-1)+check(i,j)
      +check(i-1,j)+check(i,j-1);
    maxm=max(maxm,b-a);
      }
      t[i][j]=tmp;
    }
  }
  cout<<total+maxm<<endl;
  return 0;
}

Measured memory_bytes: 2160
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define P pair<ll, ll>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((int)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;




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


int main() {
    ll H, W; cin >> H >> W;
    Vs s(H);
    rep(i, 0, H) cin >> s[i];

    rep(h, 0, H){
        rep(w, 0, W){
            if(s[h][w] == '#'){
                bool f = false;
                if(h-1 >= 0 && s[h-1][w] == '#') f = true;
                if(h+1 < H && s[h+1][w] == '#') f = true;
                if(w-1 >= 0 && s[h][w-1] == '#') f = true;
                if(w+1 < W && s[h][w+1] == '#') f = true;
                if(!f){
                    co("No");
                    return 0;
                }
            }
        }
    }
    co("Yes");

    return 0;
}


Measured memory_bytes: 256
import sys
n, W = map(int, sys.stdin.readline().split())
L = [list(map(int, sys.stdin.readline().split())) for _ in range(n)]

dp = [[0 for _ in range(W+1)] for _ in range(n)]
for w in range(W+1):
    if w>=L[0][0]:
        dp[0][w] = L[0][1]

#print(dp)
for i in range(1, n):
    for w in range(W+1):
        if w <L[i][0]: #そもそも加えられないとき
            dp[i][w] = dp[i-1][w] #前回の状態を代入。
        else: #加えようとしたら入るとき
            dp[i][w] = max(dp[i-1][w-L[i][0]] + L[i][1], dp[i-1][w]) #max(加えた時の価値, 前回の状態)
            
#print(dp)
print(max(dp[-1]))

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

namespace abc107_a
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(input[0]);
            int b = Convert.ToInt32(input[1]);

            int c = a - b + 1;

            Console.WriteLine(c);
            Console.Read();
        }
    }
}


Measured memory_bytes: 13268
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 10 21:28:22 2018

@author: maezawa
"""

n = int(input())

c = [1, 6, 36, 216, 1296, 7776, 46656,
     9, 81, 729, 6561, 59049]
m = len(c)

dp = [float('inf') for _ in range(n+1)]
dp[0] = 0
#print(n,m)
#print(c)
#print(*dp, sep='\n')

for j in range(1,n+1):
    temp = []
    for i in range(m):
        if j < c[i]:
            continue
        else:
            temp.append(dp[j-c[i]]+1)
    dp[j] = min(temp)

print(dp[n])

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

using namespace std;
#define BUF (1000)

char s[BUF]; 

int main(void){
	cin >> s;

	for(int i=0;i<strlen(s)-1;i++){
		if(s[i] == 'A' && s[i+1] == 'C' ){
			 cout << "Yes" << endl;
			 return 0; 
		}
	}


	cout << "No" << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
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; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    string s;
    cin >> s;
    s = "h" + s;
    if(s[3] == s[4] && s[5] == s[6])cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3616
def solve():
	n,_,*t=map(int,open(0).read().split());r=[n+1]*(n+1)
	for a,b in zip(*[iter(t)]*2):
		r[a]=min(r[a],b)
	a=0;cur=n+1
	for i in range(n+1):
		cur=min(cur, r[i])
		if i==cur:
			#追いついた
			cur=r[i]
			a+=1
	print(a)
if __name__=="__main__":
	solve()

Measured memory_bytes: 25132
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
  string A;
  string B;
  string C;
  cin >>A>>B>>C;
  
  int a=A.size();
  int b=B.size();
  int c=C.size();
  int a1=0;
  int b1=0;
  int c1=0;
  int x=max(max(a,b),c);
  
  
  char cs='A';
 
  rep(i,3*x) {
  
    
    
    
    if((cs=='A') &&( A.at(a-1)!='z')) {
   
     a1++;
     if(A.at(a1-1)=='b') {
       cs='B';
       A.at(a1-1)='z';
       
     }
       if(A.at(a1-1)=='c') {
       cs='C';
       A.at(a1-1)='z';
         
     }
     if(A.at(a1-1)=='a') {
       cs='A';
       A.at(a1-1)='z';
       
     }
   }
    
    
    
    
    
    if((cs=='B') &&( B.at(b-1)!='z')) {
   
     b1++;
     if(B.at(b1-1)=='b') {
       cs='B';
       B.at(b1-1)='z';
       
     }
       if(B.at(b1-1)=='c') {
       cs='C';
       B.at(b1-1)='z';
         
     }
     if(B.at(b1-1)=='a') {
       cs='A';
       B.at(b1-1)='z';
       
     }
     }
       
     
    
    
    
    
    
    if((cs=='C') &&( C.at(c-1)!='z')) {
   
     c1++;
     if(C.at(c1-1)=='b') {
       cs='B';
       C.at(c1-1)='z';
       
     }
       if(C.at(c1-1)=='c') {
       cs='C';
       C.at(c1-1)='z';
         
     }
     if(C.at(c1-1)=='a') {
       cs='A';
       C.at(c1-1)='z';
       
     } 
       }  
  
     if((cs=='A') &&( A.at(a-1)=='z')) {
       cout<<"A"<<endl;
       break;
     }
  
     if((cs=='B') &&( B.at(b-1)=='z')) {
       cout<<"B"<<endl;
       break;
     }
    
     if((cs=='C') &&( C.at(c-1)=='z')) {
       cout<<"C"<<endl;
       break;
     }
    
    
    
    
    
    
    
  
  }  //rep,end
    
     

   
  
  
  
  
  
      
  
       }  //finale
  
 


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define print(x) cout << (x) << endl;
#define printa(x, n) for(ll i = 0; i < n; i++) {cout << (x[i]) << " ";} cout << endl;
using namespace std;
using ll = long long;

int main(void) {
    int n;
    map<string, int> mp;

    cin >> n;
    
    rep (i, n) {

        string s; cin>>s;mp[s]++;
    }

    int cnt = 0;
    vector<string> ans;

    for (auto x : mp) {
        cnt = max(cnt, x.second);
    }

    for (auto x : mp) {
        if (x.second == cnt) ans.push_back(x.first);
    }

    sort(ans.begin(), ans.end());

    rep (i, ans.size()) cout << ans[i] << endl;
    
    return 0;
}

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

def main():
    h, w = map(int, input().split())
    c = [list(map(int, input().split())) for i in range(10)]
    a = [list(map(int, input().split())) for i in range(h)]

    warshall_floyd(c)
    res = 0
    for i in range(h):
        for j in range(w):
            x = a[i][j]
            if x != -1:
                res += c[x][1]
    print(res)

def warshall_floyd(adj_mat):
    for k in range(10):
        for i in range(10):
            for j in range(10):
                adj_mat[i][j] = min(adj_mat[i][j], adj_mat[i][k] + adj_mat[k][j])

if __name__ == "__main__":
    main()


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

const int mod = 1000000007;

ll dp[1<<21] = {0};
int main() 
{
    int n;
    cin >> n;
    int a[n][n];
    rep(i,n)rep(j,n) cin >> a[i][j];

    dp[0] = 1;
    for (int b=1; b< 1<<21; b++) {
        int i = __builtin_popcount(b);
        rep(j,n) {
            if ((b>>j & 1) && (a[i-1][j] == 1)) {
                dp[b] += dp[b&~(1<<j)];
                dp[b] %= mod;
            }
        }
    }
    cout << dp[(1<<n) - 1] << endl;


    return 0;
}


Measured memory_bytes: 16640
#include <iostream>

using namespace std;

int main(){
  char c;
  string str;
  int cnt = 0;

  while(cin >> str , str != "0"){
    cnt++;
    if(cnt == 4) cnt = 1;

    int len = (int)str.size();
    int a = 0, b = 0;

    for(int i = 1 ; i < len ; i++){
      if(str[i] == 'A'){
	a++;
      }else{
	b++;
      }
    }
    if(a < b){
      cout << a << " " << b+1 << endl;
    }else{
      cout << a+1 << " " << b << endl;
    }
  }

  return 0;
}

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

int main()
{
    double a, b, c, S, L, h;
    cin >> a >> b >> c;
    double rad = c * M_PI / 180;
    
    S = 1.0/2 * a * b * sin(rad);
    L = a + b + sqrt(a*a + b*b - 2*a*b*cos(rad));
    h = b * sin(rad);
    
    printf("%.10lf\n%.10lf\n%.10lf\n", S, L, h);
}



Measured memory_bytes: 3432
N, T = gets.chomp.split(" ").map(&:to_i)
S = gets.chomp.split(" ").map(&:to_i)

S << (S[-1] + T + 1)
s, ans = [0, 0]
(0...N).each{|i|
  if S[i+1] - S[i] > T then
    ans += (S[i] + T - s)
    s = S[i+1]
  end
}

puts ans


Measured memory_bytes: 17924
package main

import (
	"fmt"
)

func main() {
	var text string
	fmt.Scan(&text)

	var E0, E1, O0, O1 int
	for i, t := range text {
		if i%2 == 0 {
			if t == '0' {
				E0++
			} else {
				E1++
			}
		} else {
			if t == '0' {
				O0++
			} else {
				O1++
			}
		}
	}
//	fmt.Println(min(E0+O1, E1+O0))
if 	E0+O1 < E1+O0 {
	fmt.Println(E0+O1)
	}else {
	fmt.Println(E1+O0)
}



}

/*
func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}
*/


Measured memory_bytes: 1280
/* 
                     ... .
               xdM*"""*+"9M
            xM"             "M
          MP"                 "M
        ,M/|,                 \`4
      n"   /|/.          .\  \\``4
     d)    <~!-'        \^`\  `   n
     M"                           \
     M.          !: uu<            ;
     M@ @        !$$$$!:           r
       h?M  <.`.`t$$$$X".( /< xh   >
        "M <`:x~NX$$$$Ub>*cXW !X   L
         M `X!@k:$$$$$$$r $$$Lr    M
         M   '9$$$$$$$$$$$$$F"     4
         ~    ?$$$x$$$$$$$$P        M
        h      !$$$d%m@$$"f          L
        *        #$$$$$)$:>           ":,
         x      ` `#$R!$\!  :            "\._
          h   < < !..!JR  ~<<             -n.`\
       ..x**  < 'ouk!!$f~  <<   ...         ^*.;
   ....( !! << \NdC*$@$><~  << !!!:!!<.       "M
  xJ"<!!<!~<<<dNeRV$$$R    <<< !!!!!!:<:       `M
  M%<!!!! <<~:`(3$$$R?<<<<<<~< !!?!:<<<<<       M
  M<<!!!!' :<<:x$$$!!<<<<<<<<.!~:~<<<<<<<   k   M
 n!<<<!   <<<~<$$$?~ '<<<<<<:'.!`<<<<<~ ~  :|  /
 M<<<<   '  ~ <$$R?.  `<~   <'!<<< <<<< ~  ;/ z
 "<<<<<  : < <  M#!    <<   <<   <<<<<<h> / v'
  <<<<<>< <~<<   .uoN :<<<  <<  <<<<<<<:eVa
  <<<<<< '<<<    !$$$$<<<<<   :<<<<<<<<<<' )
  <<<<<` < <~     R$$$N      <<<<<<<<<<<<e~
  <<< <   `        $$$$$.    ~``~<<<<<< x"
  k<<<<            `$$$$$b   :<<<<`<<<<MC
  M<<<<             "$$$$$!<< :<`~<<!<d""
  f<<<<:             #$$$$!<<<<~<:<<<<M
 P<<<:<<~  :          #$$?~ <<   <`<<tM
 <<<<~:~`<<<<::        "`   `<     ~MJ>
 :<< ~:<<<<<::.                  ..<$f
 M  <<<<<<:!XN$$$bu.        ..uo$#3$!4M
  x  <<~  !!#$$$$$$$$$eiL.d$$$#\Le$!!XP
  '.       !!!!??#$$$$$$$$$$$****#?XMr
    `-.            ```~""!!!!!!XXnHC
       `-'\               '"*xd
*/

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

int main(){
    long long int n;
    scanf("%lld",&n);
    cout << (n*(n+1))/2;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;

int main() {
    int K; cin >> K;
    string s;
    for (int i = 0; i < K; ++i) s += "ACL";
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define ff first
#define ss second
#define vll vector<ll>
#define pii pair<ll,ll>
#define sz(v) (v).size()
#define srt(v) sort(v.begin(),v.end())
#define ull unsigned long long
#define tell(a) cout<<a<<" "
#define el cout<<endl
#define rev(v) reverse(v.begin(),v.end())
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ld long double
#define mem(a,b) memset(a,b,sizeof(a) )
#define M 4000010
#define md 1000000007

ll power(ll x, ll y, ll p){ll res = 1;x = x % p;while (y > 0){   if (y & 1)res = (res*x) % p;y = y>>1;
x = (x*x) % p;}return res;}
/*inline ll add(ll a,ll b){return (a+b)%md;}
inline ll mul(ll a,ll b){return (a*b)%md;}
ll f[M],iv[M];
ll C(ll n,ll r){return mul(f[n],mul(iv[r],iv[n-r]));}
void prep_fac(){
    f[0]=1;
    rep(i,1,M)f[i]=mul(i,f[i-1]);
    iv[M-1]=power(f[M-1],md-2,md);
    for(ll i=M-2;i>=0;--i)iv[i]=mul(i+1,iv[i+1]);
}*/
int k;
bool fu(ll m,ll *a ,int n){
	if(m==0)return 1;
	int c=0;
	for(int i=0;i<n;i++){
		if(a[i]<=m)
		break;	
		if(a[i]%m==0)
		{
			c=c+(a[i]/m-1);	
		}	
		else
		{
			c=c+a[i]/m;
		}
	}
	return c<=k;
}

int main()
{
	IOS;
	int n;
	cin>>n>>k;
	ll a[n];
	rep(i,0,n)cin>>a[i];
	sort(a,a+n);
	reverse(a,a+n);
	ll l=1,h=a[0];
	ll ans=-1;
	while(l<=h){
		ll m=l+(h-l)/2;
		if(fu(m,a,n)){
			ans=m;
			h=m-1;
		}
		else
		l=m+1;
	}
	cout<<ans;
}



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

#include <iostream>
#include<vector>
using namespace std;
typedef long long ll;
ll PowMod(long long a, long long n, long long p) {
  if (n == 1) return a % p;
  if (n % 2 == 1) return (a * PowMod(a, n - 1, p)) % p;
  long long t = PowMod(a, n / 2, p);
  return (t * t) % p;
}
int main() {
	ll n,k;cin>>n>>k;
	ll def=1;
	vector<ll> num(k+1);
 	for(int i=0;i<9;i++)def*=10;
	def+=7;
//	cout<<'A'<<endl;
	for(int i=k;i>=1;i--){
//		cout<<i<<endl;
		ll count=k/i;
		num[i]=PowMod(count,n,def);
		for(int j=1;j<count;j++){
			num[i]-=num[i+j*i];
		}
		num[i]%=def;
//		cout<<i<<' '<<num[i]<<endl;
	}
//	cout<<'B'<<endl;
	ll ans=0;
	for(int i=1;i<=k;i++){
		ans+=i*num[i];
		ans%=def;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 4052
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string>
#include<stdexcept>
#include<stdio.h>
#include<queue>
#include <cmath>
//for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<n;i++) cin >> x[i];
#define pi pair<int,int> 
using namespace std;

int main(){
    int ans=10000000;
    int n,l;
    cin >> n >> l;
    int sum=n*l+n*(n-1)/2;
    for(int i=0;i<n;i++){
        int summ = sum-(l+i);
        int a=abs(sum-summ);
        ans=min(ans,a);
    }
    for(int i=0;i<n;i++)
    if(ans==abs(l+i)) cout << sum-(l+i);
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>

using namespace std;
typedef long long ll;

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

int main() {

    ll N;
    cin >> N;
    ll A[N];
    ll max = 0;
    ll sum = 0;
    rep(i,N){
        cin >> A[i];
        if(i>0){
            if(A[i]<=A[i-1]){
                sum++;
            }
            else{
                if(sum>max) max = sum;
                sum = 0;
            }
        }
    }
    if(sum>max) max = sum;
    cout << max << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
using namespace std;

typedef long long ll;


int n;
int a[301][301];
int d[301][301];
bool flag = true;
ll ans = 0;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> a[i][j];
			d[i][j] = a[i][j];
		}
	}
	for (int i = 0; i < n; i++) d[i][i] = 0;
	for (int k = 0; k < n; k++) {
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			flag = flag && (d[i][j] == a[i][j]);
		}
	}
	if (!flag) cout << -1 << endl;
	else {
		for (int k = 0; k < n; k++) {
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if (d[i][j] != 0 && d[i][k] != 0 && d[k][j] != 0) {
						if (d[i][j] == d[i][k] + d[k][j]) {
							d[i][j] = 0;
							d[j][i] = 0;
						}
					}
				}
			}
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= i; j++) {
				ans += d[i][j];
			}
		}
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 896
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
const int MAXN=1000005,MAXM=30000000;
int P;
#define L 1048576
#define real long double
#define eps 1e-9
char _buf[L],*S,*T,_buf1[L],*S1=_buf1;
inline char gc()
{
	if(S==T)
	{
		T=(S=_buf)+fread(_buf,1,L,stdin);
		if(S==T)return 0;
	}
	return *S++;
}
template<class T> void get(T &x)
{
	char c;
	for(c=gc();(c<'0'||c>'9')&&c!='-';c=gc());
	bool b=0;
	if(c=='-')
	{
		b=1;
		c=gc();
	}
	for(x=c^'0',c=gc();c>='0'&&c<='9';c=gc())x=(x<<3)+(x<<1)+(c^'0');
	if(b)x=-x;
}
inline void pc(char c)
{
	if(S1==_buf1+L)
	{
		fwrite(_buf1,1,L,stdout);
		S1=_buf1;
	}
	*S1++=c;
}
void out(ll x)
{
	if(x>9)out(x/10);
	pc(x%10^'0');
}
int Pow(int x,int y)
{
	int s=1;
	for(;y;y>>=1,x=(ll)x*x%P)if(y&1)s=(ll)s*x%P;
	return s;
}
int A(int x)
{
	return x<0?-x:x;
}
int n,i,a[105],ans;
int main()
{
	get(n);
	for(i=1;i<=n;i++)get(a[i]);
	for(i=1;i<=n;i++)if((i&1)&&(a[i]&1))ans++;
	cout<<ans<<endl;
	fwrite(_buf1,1,S1-_buf1,stdout);
	return 0;
}

Measured memory_bytes: 3608
#include<iostream>
#include<cstdio>
#include<string.h>
using namespace std;
int main()
{
	int n,k,a,b,money;
	cin>>n>>k>>a>>b;
	if(n>k)
	{
		money=k*a+(n-k)*b;
	}
	else
		money=n*a;
	cout<<money<<endl;
	return 0;
}

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

int a[3];
int main(){
    rep(i,3) cin>>a[i];
    sort(a,a+3);
    int cnt=0;
    if((a[2]-a[0])%2==0&&(a[2]-a[1])%2==0){
        cnt+=(a[2]-a[0])/2;
        cnt+=(a[2]-a[1])/2;
    }
    else if((a[2]-a[0])%2==1&&(a[2]-a[1])%2==1){
        cnt+=(a[1]-a[0])/2;
        cnt+=a[2]-a[1];
    }
    else if((a[2]-a[0])%2==0&&(a[2]-a[1])%2==1){
        ++cnt;
        cnt+=(a[2]-a[0])/2;
        cnt+=(a[2]+1-a[1])/2;
    }
    else if((a[2]-a[0])%2==1&&(a[2]-a[1])%2==0){
        ++cnt;
        cnt+=(a[2]+1-a[0])/2;
        cnt+=(a[2]-a[1])/2;
    }
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long 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;}

int main(){
   int a;
   cin >> a;
   string s;
   cin >> s;
   if(a>=3200){
      cout << s << endl;
   }else cout << "red" << endl;
   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define PI acos(-1)
#define sz 100010
#define RUN_FAST ios::sync_with_stdio(false);
using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    int arr[n], i;
    for (i=0; i<n; i++) scanf("%d", &arr[i]);
    sort(arr, arr+n);
    for (i=1; i<n; i++) {
        if (arr[i]==arr[i-1]) {
            printf("NO\n");
            return 0;
        }
    }
    printf("YES\n");
}


Measured memory_bytes: 4400
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int K = 305;
int MOD = 1000000007;
int dp[2*K][K][K];
int ddp[2*K][K];
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> v(2*n);
    for (int i=0; i < 2*n; i++) cin >> v[i];
    vector<bool> used;
    used.resize(2*n, false);
    for (int i=0; i < 2*n; i++) if (v[i] != -1){
        used[v[i]-1] = true;
    }
    vector<pair<int, int> > arr;
    for (int i=0;i<2*n;i++) if (!used[i]) arr.push_back({i, 0});
    int free=0;
    for (int i=0; i < 2*n;i+=2){
        int A = v[i], B = v[i+1];
        if (A>B) swap(A, B);
        if (B==-1) free++;
        if (A!=-1 || B==-1) continue;
        arr.push_back({B-1, 1});
    }
    sort(arr.begin(), arr.end());
    dp[0][0][0] = 1;
    int balance=0;
    for (int i=0; i < arr.size(); i++){
        for (int nums=0; nums < K; nums++) for (int cells=0; cells < K; cells++){
            if (arr[i].second == 0){
                if (nums+1 < K){
                    dp[i+1][nums+1][cells] += dp[i][nums][cells];
                    dp[i+1][nums+1][cells] %= MOD;
                }
                if (cells>0){
                    dp[i+1][nums][cells-1] += dp[i][nums][cells];
                    dp[i+1][nums][cells-1] %= MOD;
                }
                if (cells+1<K){
                    int diff = (balance-(nums-cells))/2;
                    //if (dp[i][nums][cells])cout << "!!!" << i << " " << balance << " " << nums << " " << cells << endl;
                    dp[i+1][nums][cells+1] += dp[i][nums][cells]*(free-diff);
                    dp[i+1][nums][cells+1] %= MOD;
                }
            }
            else{
                if (nums){
                    dp[i+1][nums-1][cells] += dp[i][nums][cells] * nums;
                    dp[i+1][nums-1][cells] %= MOD;
                }
                if (cells+1<K){
                    dp[i+1][nums][cells+1] += dp[i][nums][cells];
                    dp[i+1][nums][cells+1] %= MOD;
                }
            }
        }
        if (arr[i].second == 0) balance++;
        else balance--;
    }
//    for (int i=0;i<=arr.size();i++) for (int j=0; j < 4; j++) for (int k=0; k < 4; k++){
//        cout << i << " " << j << " " << k << " " << dp[i][j][k] << endl;
//    }
    int ans = dp[arr.size()][0][0];
//    int free = 0;
//    for (int i=0;i<2*n;i+=2) if (v[i]==-1 && v[i+1]==-1) free++;
//    ddp[0][0] = 1;
//    for (int i=0; i < 2*free; i++){
//        for (int j=0; j < K; j++){
//            ddp[i+1][j] += ddp[i][j];
//            ddp[i+1][j] %= MOD;
//            if (2*(j+1) <= i+1){
//                ddp[i+1][j+1] += ddp[i][j];
//                ddp[i+1][j+1] %= MOD;
//            }
//        }
//    }
//    ans *= ddp[2*free][free];
//    ans %= MOD;
//    for (int i=1;i<=free;i++){
//        ans *= i;
//        ans %= MOD;
//    }
    cout << ans;
    return 0;
}



Measured memory_bytes: 436480
//Sorting a Segment:

/*
Website for this problem:
https://atcoder.jp/contests/agc038/tasks/agc038_b
*/

/*
Writer of this code:
LHic
*/

#include <bits/stdc++.h>
using namespace std;
const int N=(2e5+1e4);
int n, k;
int a[N];
int go[N];
set<int>ss;
int ans=0;
int i;
int main()
{
	scanf("%d%d",&n,&k);
	for (i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
 	go[0]=0;
	for(i=1;i<n;i++)
	{
		if (a[i]>a[i-1]) 
		{
			go[i]=go[i-1]+1;
		}
		else
		{
			go[i]=0;
		}
		if (go[i]>=(k-1)) 
		{
			ans=1;
		}
	}
	for(i=0;i<k;i++)
	{
		ss.insert(a[i]);
	}	
	if(go[k-1]!=k-1)
	{
		ans++;
	}
	for(i=k;i<n;i++)
	{
		ss.insert(a[i]);
		if(((*(ss.begin()))!=a[i-k])||((*(ss.rbegin()))!=a[i]))
		{
			if(go[i]<k-1)
			{
				++ans;
			}
		}
		ss.erase(a[i-k]);
	}
	printf("%d",ans);
	return 0;
}

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

namespace BeginnerCont92
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var tmp = Console.ReadLine().Split();
            var d = int.Parse(tmp[0]);
            var x = int.Parse(tmp[1]);
            var an = new int[n];
            for(int i = 0; i < n; i++)
            {
                an[i] = int.Parse(Console.ReadLine());
            }
            var sum = 0;
            foreach (var a in an)
            {
                sum += 1 + (d - 1) / a;
            }
            sum += x;
            Console.WriteLine(sum.ToString());
        }
    }
}


Measured memory_bytes: 11092
#pragma region head
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define int long long
typedef long long ll;
#define double long double
typedef double ld;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;
const double PI = acos(-1.0);

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
#pragma endregion

signed main() {
  string S;
  cin >> S;
  string T;
  cin >> T;

  int s = len(S), t = len(T);

  vector<int> SA(s + 1), SB(s + 1);
  rep(i, s) {
    SA[i + 1] = SA[i] + (S[i] == 'A');
    SB[i + 1] = SB[i] + (S[i] == 'B');
  }

  vector<int> TA(t + 1), TB(t + 1);
  rep(i, t) {
    TA[i + 1] = TA[i] + (T[i] == 'A');
    TB[i + 1] = TB[i] + (T[i] == 'B');
  }


  int q;
  cin >> q;
  while (q-- > 0) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    a--, c--;
    int ss = (SA[b] - SA[a]) - (SB[b] - SB[a]);
    int tt = (TA[d] - TA[c]) - (TB[d] - TB[c]);

    if ((ss - tt) % 3 == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}

Measured memory_bytes: 4048
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

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

int main(){

    string s; cin>>s;
    int ma = 0;
    int co = 0;
    int ans = 0;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == 'R') co++;
        else {
            ans = max(co,ans);
            co = 0;
        }
    }
    ans = max(co,ans);
    cout<<ans<<"\n";
}


Measured memory_bytes: 3592
#include <cstdio>
#include <algorithm>

using namespace std;

const int MAXN = 1e5+5;

int n;
int h[MAXN];
int dp[MAXN];

int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", h+i);
  }

  dp[n-1] = 0;
  dp[n-2] = abs(h[n-1]-h[n-2]);
  for (int i = n-3; i >= 0; --i) {
    dp[i] = min(
        abs(h[i]-h[i+1]) + dp[i+1],
        abs(h[i]-h[i+2]) + dp[i+2]);
  }

  printf("%d\n", dp[0]);
  return 0;
}



Measured memory_bytes: 896
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;

typedef long long ll;

#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define rep_r(i,n,m) for(int i=m; i<n; i++)
#define END cout << endl
#define MOD 1000000007
#define pb push_back
// 昇順sort
#define sorti(x) sort(x.begin(), x.end())
// 降順sort
#define sortd(x) sort(x.begin(), x.end(), std::greater<int>())

int main() {
  int a,b,n;
  cin >> n >> a >> b;
  string s; cin >> s;

  int cnta = 0, cntb = 0;
  rep(i,n) {
    if (s[i] == 'c') {
      cout << "No" << endl;
      continue;
    }

    int lim = cnta + cntb;
    if (s[i] == 'a') {
      if (lim < a + b) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
      cnta += 1;
    } else if (s[i] == 'b') {
      if (lim < a + b) {
        if (cntb < b) {
          cout << "Yes" << endl;
          cntb += 1;
        } else {
          cout << "No" << endl;
        }
      } else {
        cout << "No" << endl;
      }
    }
  }
}


Measured memory_bytes: 896
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <deque>
#include <map>
#include <fstream>
#include <utility>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <random>
#include <math.h>
#include <cassert>
#include <bitset>
#include <chrono>
#include <sstream>
#include <array>

using namespace std;

#define DEBUG_VIVOD " SHTO-TO POSHLO NE TAK\n"
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define pf push_front
#define _USE_MATH_DEFINES
#define filin(x) freopen(x, "r", stdin)
#define filout(x) freopen(x, "w", stdout)
#define deq deque
#define vec vector
#define umap unordered_map
#define uset unordered_set
#define nan nullptr
#define rtn(x) {return x;}
#define putin cin
#define putout cout


//typedef long long ll;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned long long ui;

#define INF 1e9
mt19937 prof_rand(time(0));
#define rnd prof_rand()
#define MOD (1e9 + 7)



signed main() {
    ll n; putin >> n;
    map<pair<ll, ll>, ll> kk;
    while (n--) {
        ld mk; putin >> mk;
        ll tmp = llround(mk * 1e9);
        ll t = 0, f = 0;
        while (tmp % 2 == 0) {tmp /= 2; t++;}
        while (tmp % 5 == 0) {tmp /= 5; f++;}
        kk[make_pair(t, f)]++;
    }
    ll ans = 0;
    for (auto& it : kk) for (auto& jt : kk)
        if (it.first.first + jt.first.first >= 18 && it.first.second + jt.first.second >= 18) {
            if (it < jt) ans += it.second * jt.second;
            else if (it == jt) ans += it.second * (it.second - 1) / 2;
        }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3784
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner; 
import java.util.StringTokenizer; 
  
public class Main
{ 
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
  
    public static void main(String[] args) 
    { 
        FastReader fr = new FastReader(); 
        
        int N = fr.nextInt();
        int K = fr.nextInt();
        
        int[] dp = new int[N];
        Arrays.fill(dp, (int)2e9); dp[0] = 0;
        
        int[] h = new int[N];
        
        for(int i = 0; i < N; i++) {
        	h[i] = fr.nextInt();
        }
        
        for(int i = 0; i < N; i++) {
        	for (int j = 1; j <= K; j++) {
        		if (i + j < N) {
        			dp[i+j] = Math.min(dp[i+j], dp[i] + Math.abs(h[i] - h[i+j]));
        		}
        	}
        }
        
        System.out.println(dp[N-1]);
        
        
        
    }
}


Measured memory_bytes: 43932
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x;
    int a[n];
    int sum=0;
    int count=0;
    cin>>n>>x;
    for(int i=0; i<n; i++)
    {
        if(sum<=x)
            count++;
        cin>>a[i];
        sum+=a[i];
    }
    if(sum<=x)
        count++;
    cout<<count;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <unordered_map>
#include <assert.h>
using namespace std;
typedef long long ll;

const int mxn = 2e5 + 10;
int N;
int A[mxn];
unordered_map<int, int> cnt;


int main() {
	cin >> N;
	cnt.clear();
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < N; i++) {
		cnt[A[i]]++;
	}

	if (cnt.find(1) != cnt.end()) {
		if (cnt[1] == 1) {
			cout << 1 << '\n';
		}
		else {
			cout << 0 << '\n';
		}
		return 0;
	}

	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (cnt[A[i]] > 1) {
			continue;
		}

		bool ok = true;
		for (int f = 2; f * f <= A[i]; f++) {
			if (A[i] % f == 0) {
				if (cnt.find(f) != cnt.end() || cnt.find(A[i] / f) != cnt.end()) {
					ok = false;
					break;
				}
			}
		}

		if (ok) {
			ans++;
		}
	}
	cout << ans << '\n';
}

Measured memory_bytes: 12068
N,Q = map(int, input().split())
v = [[] for _ in range(N+1)]
w = [0]*(N+1)

for _ in range(N-1):
    a,b = map(int, input().split())
    v[a].append(b)
    v[b].append(a)

for j in range(Q):
    p,x = map(int, input().split())
    w[p]+=x

q=[(1,0)]
while q:
    c,p = q.pop()
    w[c]+=w[p]
    for x in v[c]:
        if x==p:
            continue
        q.append((x,c))

print(' '.join([str(x) for x in w[1:]]))

Measured memory_bytes: 65276
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;
#define INF 99999
#define _GLIBCXX_DEBUG

//repetition
//------------------------------------------
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define REPS(i,a,n) for(int i=(a);i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define fi first
#define se second

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

typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;


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

    int N, K;
    cin >> N >> K;
    vint x(N);
    REP(i, N) cin >> x[i];

    int sum = 0;
    REP(i, N){
        if(K/2.0f <= x[i]){
            sum += (K - x[i]) * 2;
        } else {
            sum += x[i] * 2;
        }
    }
    cout << sum;


}

Measured memory_bytes: 256
n = input()
l = len(n)-1
for i in range(2**l):
  s = n[0]
  a = int(n[0])
  for j in range(l):
    if i >> j & 1:
      s += "+"
      a += int(n[j+1])
    else:
      s += "-"
      a -= int(n[j+1])
    s += n[j + 1]
  if a == 7:
    print(s + "=7")
    break

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

using namespace std;

#define ALL(x) (x).begin(), (x).end()
#define AND(x,y,z) 
#define DUMP(xs) for (auto x:xs) cout<<x<<' ';cout<<endl
#define DUMPP(xs) for (auto x:xs) cout<<'('<<x.first<<','<<x.second<<')';cout<<endl
#define FOR(i,a,b) for (ll i=(ll)(a);i<(ll)(b);++i)
#define OUT(x) cout<<x<<endl
#define REP(i,n) FOR(i,0,n)
#define YES(cond) cond ? OUT("YES") : OUT("NO")
#define Yes(cond) cond ? OUT("Yes") : OUT("No")

template<class T> T gcd(const T x,const T y){if(!y){return x;}return gcd(y,x%y);}
template<class T> T lcm(const T x,const T y){return x/gcd(x,y)*y;};
template<class T> T modpow(T x,T n,const T mod) {
  T res=1;while(n>0){if(n%2)res=res*x%mod;x=x*x%mod;n/=2;};return res;
}
template<class T> T modinv(T x,const T mod){return modpow(x,mod-2,mod);}
template<class T> bool alltrue(const T &a){return all_of(ALL(a),[](bool x){return x;});}
template<class T> bool anytrue(const T &a){return any_of(ALL(a),[](bool x){return x;});}
template<class T> bool contain(const T &a,const T &b){for(auto x:b){if (a.find(x)==a.end()){return false;}}return true;}
template<class T> bool mmax(T &m,const T q){ if (m < q) {m = q; return true;} else return false; }
template<class T> bool mmin(T &m,const T q){ if (m > q) {m = q; return true;} else return false; }
template<class T> int siz(const T &a) {return (int)a.size();}
template<class T> set<T> devisers(T n) {
  set<T> res;for(T i=1;i<(T)sqrt(n)+1;i++){if(n%i==0){res.insert(i);res.insert(n/i);}}return res;
}
template<class T> void concat(T &a, const T &b){a.insert(a.end(),b.begin(),b.end());}
template<class T> void getand(const T &a,const T &b,T &c) {
  set_intersection(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.end()));
}
template<class T> void getor(const T &a,const T &b,T &c) {
  set_union(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.end()));
}

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

const ll MOD=1e9+7;
const int MAX=1e7+100;

int main() {
  ll A,B;cin>>A>>B;
  Yes(A%2==1 && B%2==1);

  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main() {
	long long N;
	cin >> N;
	long long ans = 0;
	long long MIN = 10000000000;
	long long L = 0;
	vector<long long>A(N);
	for (long long i = 0; i < N; i++) {
		cin >> A.at(i);
		long long ABS = abs(A.at(i));
		ans += ABS;
		if (MIN > ABS) MIN = ABS;
		if (A.at(i) < 0) L++;
	}
	if (L % 2 != 0) cout << ans - MIN - MIN << endl;
	else cout << ans << endl;
}

Measured memory_bytes: 1152
//#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<cmath>
#include<map>
#include<unordered_map>
#include<functional>
#include<queue>
#include<set>
#include<stack>
#include<iomanip>
#include<algorithm>
#include<numeric>
#include<memory>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(a)   a.begin(),a.end()
template<typename T =ll> using v = vector<T>;
template<typename T =ll> using vv = v<v<T>>;
template<typename T =ll,typename U =ll> using p = pair<T,U>;
template<typename T> T chmin(T &a,T b) {return a=min(a,b);}
template<typename T> T chmax(T &a,T b) {return a=max(a,b);}
const ll INF = (ll)1e9;
template <int MOD>
struct ModInt {
    using lint = long long;
    int val;

    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };

    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt inv() const { return this->pow(MOD - 2); }

    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
    ModInt pow(lint n) const {
        auto x = ModInt(1);
        auto b = *this;
        while (n > 0) {
            if (n & 1) x *= b;
            n >>= 1;
            b *= b;
        }
        return x;
    }

    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }
    //
    ModInt operator++(int) {
        auto t = *this;
        *this += 1;
        return t;
    }

    ModInt operator--(int) {
        auto t = *this;
        *this -= 1;
        return t;
    }
    ModInt operator<<(const int n){
        return ModInt(*this)*ModInt(2).pow(n);
    }
    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }

    // I/O
    friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept { return is >> x.val; }
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

constexpr int MOD = 1e9 + 7;
using mint = ModInt<MOD>;

void a(){
    ll A;
    cin >> A;
    cout << A+A*A+A*A*A;
}
void b(){}
void c(){}
void d(){}
void e(){}


int main(){
    a();
}

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

#define int long long

#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define low(a,b) lower_bound(all(a),(b))
#define upp(a,b) upper_bound(all(a),(b))
#define fill(i,n) memset(i,n,sizeof(i)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;

int N,M,K;
string s;

signed main() {
    IOS();
    /*シフト演算は(1ll<<x)*/
    
    cin>>M;
    cout<<48-M<<endl;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

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

int n, m;
long long memo[100001];

int main() {
  cin >> n >> m;
  vector<int> a(m);
  int prev;
  for(int i = 0; i < m; i++){
    cin >> a[i];
    if(i == 0){
      prev = a[0];
      continue;
    }
    if(a[i] - prev == 1){
      cout << 0 << endl;
      return 0;
    }
    prev = a[i];
  }

  memo[0] = 0;
  memo[1] = 1;
  memo[2] = 2;
  for(int i = 3; i < 100001; i++) {
    memo[i] = (memo[i - 1] + memo[i - 2]) % 1000000007;
  }

  int start = 0, end = 0;
  long long ans = 1;
  for(int i = 0; i < m; i++){
    end = a[i] - 1;
    long long res = memo[end - start];
    if(res != 0){
      ans *= res;
      ans = ans % 1000000007;
    }
    start = a[i] + 1;
  }
  long long res = memo[n - start];
  if(res != 0) {
    ans *= res;
    ans = ans % 1000000007;
  }
  cout << ans % 1000000007 << endl;
  return 0;
}

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

int main(void)
{
	int f1, n, p, cnt;
	unsigned int k, sum, max;
	vector<int> J;

	while(cin >> n && n > 0)
	{	
		sum = 0;
		cnt = 1;
		for(f1 = 0; f1 < n; f1++)
		{
			cin >> p;
			sum += p;
		}
		for(f1 = 0; f1 < n-1; f1++)
		{
			cin >> p;
			sum += p;
			J.push_back(p);
		}

		max = sum;
		sort(J.begin(), J.end()); //平均O(nlogn)
		vector<int>::iterator t = J.begin();

		while(t != J.end())
		{
			sum -= *t;
			k = ++cnt * sum;
			
			if(k > max)
				max = k;
			t++;
		}
		J.clear();
		cout << max << endl;
	}

	return 0;
}

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

int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  for (int i = 0;i < n;i++){
    cin >> p[i];
  }
  int c = 0;
  
  for (int i = 0;i < n;i++){
    if (p[i] != i+1){
      c++;
    }
  }
  
  if (c == 0 || c == 2){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 3596