akhauriyash/Code-Regression huggingface dataset:
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define yes(n) cout << ((n) ? "yes" : "no"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define VSUM(V) accumulate(ALL(V), 0)
#define MID(a,b,c) (a) < (b) && (b) < (c)
#define MIDe(a,b,c) (a) <= (b) && (b) <= (c)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b != 0 ? gcd(b, a % b) : a;} //最大公約数
int lcm(int a, int b){return a * b / gcd(a, b);}
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

signed main() {
  RAPID;
  // デフォルト変数定義
  int n=0,m=0,a=0,b=0,c=0,d=0,x=0,y=0,z=0;
  string s="",t="";
  //

  // ここから
  IN2(s,t);
  if(s.size()==t.size()){
    REP(i,s.size()){
      cout << s[i] << t[i];
    }
  } else {
    REP(i,t.size()){
      cout << s[i] << t[i];
    }
    cout << s[s.size()-1];
  }
  cout << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    string a,b;
    cin>>a>>b;
    int i,d=0,c=0,j;
    for(i=0; i<=a.size()-b.size(); i++)
    {
        c=0;
        for(j=i; j<=i+b.size()-1; j++)
        {
            if(a[j]==b[j-i])
            {
                c++;
            }
        }
        if(c>d)
        {
            d=c;
        }
    }
    cout<<b.size()-d;
    return 0;
}

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

using namespace std;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("-ffloat-store")

#define fastio               \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);
//#define int long long
#define ll long long
#define endl "\n"
#define inf ULLONG_MAX
#define gcd __gcd
#define deb(x) cout << #x << " " << x << endl;
#define pr(x) cout << x << endl;

#define sz(a) ((ll)(a).size())
#define all(v) (v).begin(), (v).end()
#define tr(c, it) for (auto(it) = (c).begin(); (it) != (c).end(); it++)
#define pres(c, val) ((c).find(val) != (c).end())
#define cpres(c, val) (find(all(c), val) != (c).end())
#define dec greater<ll>()
#define sortv(x) sort(all(x))
#define revsortv(x) sort(all(x), dec)
#define com(x) (((x) * (x + 1)) / 2)

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define bg begin()
#define ed end()
#define bs binary_search // to find if an element is present or not in Ologn time, return a boolean
#define ub upper_bound   // to find an element strictly greater than the given no.
#define lb lower_bound   // lb(v,begin(), v.end(), n) gives the iterator

#define fo(n) for (ll i = 0; i < n; i++)
#define fo1(n) for (ll i = 1; i < n; i++)
#define fo2(i, n) for (ll i = 0; i < n; i++)
#define fo3(i, a, b) for (ll i = a; i < b; i++)
#define fors(a) cin >> a[i]
#define forp(a) cout << a[i] << " "
#define prv(a, n)  \
    fo(n) forp(a); \
    cout << endl;
#define fob(i, a, b) for (ll i = (b); i >= (a); i--)

typedef pair<ll, ll> pll;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<ll> vl;
typedef vector<pll> vll;
typedef set<ll> sl;
typedef map<string, ll> msl;
typedef unordered_map<string, ll> umsl;
typedef map<ll, ll> mll;
typedef unordered_map<ll, ll> umll;

#define scan(v, n)   \
    vl v;            \
    fo(n)            \
    {                \
        ll item;     \
        cin >> item; \
        v.pb(item);  \
    }

const ll INF = 0xFFFFFFFFFFFFFFFL;;
const ll N = 1000003;
void solve()
{
ll x;
cin>>x;
if(x>=30)cout<<"Yes";
else cout<<"No";


}
int32_t main(int32_t argc, char **argv)
{
    ios_base::sync_with_stdio(0);
   // cin.tie(0);
   // cout.tie(0);
    /*#ifndef ONLINE_JUDGE
    freopen("inputf.txt", "r", stdin);
    freopen("outputf.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif*/

    ll t;
    t=1;
 //cin >> t;

   while (t--)
        solve();

    cerr << endl
         << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";

    return 0;
}


Measured memory_bytes: 3800
#include <iostream>

using namespace std;

int main(){
  long long i=0,j=1,k=0;
  string s="";
  long long K;
  cin >> K;
  while (i<K) {
    if (j%10 == 9 || (j+1) * (9*k + (j+9-(j%10)) % 10 + (j+9-(j%10))/10) <= (j+9-(j%10)+1) * (9*k + j % 10 + j/10) || (k==0 && j<10)) {
      cout << j << s << endl;
      ++i;
    }
    ++j;
    if ((j==100 && k<12) || j==109) {
      j=10;
      s+="9";
      k+=1;
    }
  }
  return 0;
}


Measured memory_bytes: 256
/*s1190073  Rina Sato
  File name: prog8a.c
  This is a binary search tree program.
*/

#include<stdio.h>
#include<stdlib.h>

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;

#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left != NIL){
    x = x->left;
  }
  return x;
}

Node treeSearch(Node u, int k){
  while((u != NIL) && (k != u->key)){
    if(k < u->key){
      u = u->left;
    }
    else {
      u = u->right;
    }
  }
  
  return u;
}

Node treeSuccessor(Node x){
  Node y;

  if(x->right != NIL){
    return treeMinimum(x->right);
  }
  y = x->parent;
  
  while((y != NIL) && (x == y->right)){
    x = y;
    y = y->parent;
  }

  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y

  if((z->left == NIL) || (z->right == NIL)){
    y = z;
  }
  else {
    y = treeSuccessor(z);
  }

  if(y->left != NIL){
    x = y->left;
  }
  else {
    x = y->right;
  }

  if(x != NIL){
    x->parent = y->parent;
  }
  if(y->parent == NIL){
    root = x;
  }
  else if(y == y->parent->left){
    y->parent->left = x;
  }
  else {
    y->parent->right = x;
  }

  if(y != z){
    z->key = y->key;
  }
}

void Insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }
    else {
      x = x->right;
    }
  }
  z->parent = y;
  
  if(y == NIL){
    root = z;
  }
  else if(z->key < y->key){
    y->left = z;
  }
  else {
    y->right = z;
  }
  
}

void Inorder(Node u){
  if(u->left != NIL){
    Inorder(u->left);
  }
  printf(" %d",u->key);
  
  if(u->right != NIL){
    Inorder(u->right);
  }
}

void Preorder(Node u){
  printf(" %d",u->key);
  if(u->left != NIL){
    Preorder(u->left);
  }
  if(u->right != NIL){
    Preorder(u->right);
  }
}

int main(){
  int n, i, x;
  char com[20];;
  Node t;

  scanf("%d", &n);

  root = malloc(sizeof(struct node));
  root = NIL;
  
  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){ /*if I find 'x',print yes.else print no.*/
      scanf("%d", &x);
      t = treeSearch(root, x);
      if (t != NIL) printf("yes\n");
      else printf("no\n");
    } else if (com[0] == 'i'){
      scanf("%d", &x);
      Insert(x);
    } else if (com[0] == 'p'){ /*print inorder tree walk and preorder tree walk*/
      Inorder(root);
      printf("\n");
      Preorder(root);
      printf("\n");
    } else if (com[0] == 'd'){ /*delete 'x'*/
      scanf("%d", &x);
      treeDelete(treeSearch(root,x));
    }
  }

  return 0;
}

Measured memory_bytes: 9844
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let n = read_as_vec::<usize>()[0];
    let h = read_as_vec::<usize>()[0];
    let w = read_as_vec::<usize>()[0];

    println!("{}", (n-h+1)*(n-w+1));
}


Measured memory_bytes: 4352
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi acos(-1.0)

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string a, b;
    cin >> a >> b;
    if(a.size() > b.size()){
        cout << "GREATER" << "\n";
        return 0;
    }else if(a.size() < b.size()) {
        cout << "LESS" << "\n";
        return 0;
    }else{
        REP(i, a.size()){
            if(a[i] > b[i]){
                cout << "GREATER" << "\n";
                return 0;
            }else if(a[i] < b[i]){
                cout << "LESS" << "\n";
                return 0;
            }
        }
    }
    cout << "EQUAL" << "\n";

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    typedef std::pair<int, int> pair;
    vector<pair> p;
    rep(i, n) p.push_back(pair(i+1, a[i]));
    sort(all(p), [](const pair& lhs, const pair& rhs) {
        return lhs.second < rhs.second;
    });
    rep(i, n) {
        put(p[i].first)
    }
    return 0;
}

Measured memory_bytes: 4588
#include<bits/stdc++.h>
using namespace std;
#define int long long
const long long INF = 10000000000;
typedef pair <int,int> P;
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 N,W,dp[110][100000+100]={};
P p[100+10];
signed main(){
  cin >> N >> W;
  for(int i=0;i<N;i++) cin >> p[i].first >> p[i].second;
  for(int i=0;i<N;i++){
    for(int j=0;j<=W;j++){
      if(j-p[i].first>=0) chmax(dp[i+1][j],dp[i][j-p[i].first]+p[i].second);
      chmax(dp[i+1][j],dp[i][j]);
    }
  }
  cout << dp[N][W] << endl;
  return 0;
}


Measured memory_bytes: 79360
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <deque>
#include <map>
#include <iomanip>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstdint>
#include <cstring>
//#pragma warning(disable:4996)

using namespace std;


/** Type Define **/
typedef long long int           ll;
typedef pair<int, int>          pii;
typedef pair<ll, ll>            pll;
typedef vector<string>          vs;
typedef vector<bool>            vb;
typedef vector<int>             vi;
typedef vector<long long>		vl;
typedef vector<vi>              vvi;
typedef vector<vl>				vvl;
typedef vector<char>            vch;
#define		it(x)  x.begin() 
#define		all(x)  x.begin(), x.end()
#define		pb(x)   push_back(x)
constexpr int           inf = 0x3f3f3f3f;
constexpr long long 	INF = 9123456789123456789;
constexpr long long     MOD = 1000000007LL;
/*************************************************/
int n, k;

void sol() {

}

int main() {
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cin.tie(nullptr);
    cin >> n >> k;
    int ans(0);
    while (n > 0) {
        n /= k;
        ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
int main(){
    long long a,b;
    int k;
    scanf("%lld%lld%d",&a,&b,&k);
    for(int i=0;i<k;i++){
        b+=a/2;
        a/=2;
        i++;
        if(i==k)break;
        a+=b/2;
        b/=2;
    }
    printf("%lld %lld",a,b);
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

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

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

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

int dijkstra(int s, int g, int l, vector<vector<T>> &G){
    vector<vector<int>> num(110, vector<int>(110, 1e9));
    queue<T> que;
    num[s][l] = 0;
    que.push(T(0, s, l));

    while(!que.empty()){
        int cnum, cv, crest;
        tie(cnum, cv, crest) = que.front();
        que.pop();

        for(auto x : G[cv]){
            int nv, ndist, nnum;
            tie(nv, ndist, nnum) = x;
            
            if(num[cv][crest] < num[nv][crest - ndist] && ndist <= crest){
                num[nv][crest - ndist] = num[cv][crest];
                que.push(T(num[nv][crest - ndist], nv, crest - ndist));
            }
            
            if(num[cv][crest] + nnum < num[nv][crest]){
                num[nv][crest] = num[cv][crest] + nnum;
                que.push(T(num[nv][crest], nv, crest));
            }
        }
    }

    int ans = 1e9;
    for(int i=0; i<=100; i++){
        ans = min(ans, num[g][i]);
    }

    return ans;
}

int main(){
    while(1){
        int n, m, l; cin>>n>>m>>l;
        if(n == 0) return 0;
        vector<vector<T>> G(n);
        for(int i=0; i<m; i++){
            int a, b, d, e; cin>>a>>b>>d>>e;
            a--, b--;
            G[a].eb(T(b, d, e));
            G[b].eb(T(a, d, e));
        }

        cout << dijkstra(0, n-1, l, G) << endl;
    }
}


Measured memory_bytes: 3440
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <functional>
#include <algorithm>

int main() {
  std::string S;
  std::cin >> S;
  int ans = S.size();
  for (int i = 0; i + 1 < (int) S.size(); ++i) {
    if (S[i] != S[i + 1]) {
      ans = std::min<int>(ans, std::max<int>(i + 1, (int) S.size() - i - 1));
    }
  }
  std::cout << ans << std::endl;
  return 0;
}

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

using namespace std;
typedef long long ll;
//typedef unsigned long long ll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
//typedef pair<ll, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX / 100;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<char> &s, int a) { return s.find(a) != s.end(); }


//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<ll, vector<ll>, greater<ll>> PQ_ASK;
const int mod = 1000000007;

int main() {
    ll n, x, d;
    cin >> n >> x >> d;

    if (d == 0) {
        if (x == 0) {
            cout << 1 << endl;
        } else {
            cout << n + 1 << endl;
        }
        return 0;
    }

    map<int, vector<P>> mp;
    rep(i, n + 1) {
        ll s = x * i;
        ll l = i * (i - 1) / 2;
        ll r = l + i * (n - i);
        s += l * d;
        r -= l;
        mp[(s + (d << 30)) % d].emplace_back(s, r);
    }
    ll ans = 0;
    for (auto p : mp) {
        auto a = p.second;
        int m = a.size();
        rep(i, m) a[i].first = (a[i].first - p.first) / d;
        vector<P> ev;
        rep(i, m) {
            ev.emplace_back(a[i].first, 1);
            ev.emplace_back(a[i].first + a[i].second + 1, -1);
        }
        sort(ev.begin(), ev.end());
        ll count = 0, pre = -INF;
        for (auto e : ev) {
            ll len = e.first - pre;
            if (count) ans += len;
            count += e.second;
            pre = e.first;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 22144
#pragma comment(linker, "/STACK:102400000,102400000")
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)
#define inf 1000000007
#define mod 1000000007
#define x first
#define y second
#define pi acos(-1.0)
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";
//#define dprintf(...) 
#define hash _hash
//#define dprintf(...) fprintf(outFile,__VA_ARGS__)
 
#define FOREACH(it,x) for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define ull unsigned long long
#define ll long long
#define N 100010
 
template <class T,class U>inline void Max(T &a,U b){if(a<b)a=b;}
template <class T,class U>inline void Min(T &a,U b){if(a>b)a=b;}
 
//FILE* outFile;
inline void add(int &a,int b){a+=b;while(a>=mod)a-=mod;}


int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=ans*(ll)a%mod;
        a=(ll)a*a%mod;b>>=1;
    }
    return ans;
}


pii a[2002];
int b[2002],n,t[N];
void build(int p,int l,int r){
    t[p]=inf;
    if(l==r)return;
    int m=(l+r)>>1;
    build(p<<1,l,m);
    build(p<<1|1,m+1,r);
}
void upd(int p,int l,int r,int x,int v){
    Min(t[p],v);
    if(l==r)return;
    int m=(l+r)>>1;
    if(x<=m)upd(p<<1,l,m,x,v);
    else upd(p<<1|1,m+1,r,x,v);
}
int query(int p,int l,int r,int x,int y){
    if(l>=x&&r<=y)return t[p];
    int m=(l+r)>>1,ans=inf;
    if(x<=m)ans=query(p<<1,l,m,x,y);
    if(y>m)Min(ans,query(p<<1|1,m+1,r,x,y));
    return ans;
}
void upd(int x,int v){
    upd(1,0,n-1,x,v);
}
int query(int x,int y){
    if(x>y)return inf;
    return query(1,0,n-1,x,y);
}
int main(){
    //freopen("A.in","r",stdin);
    //freopen("A.out","w",stdout);
    int i,j,k,ca=0,m,K;
    scanf("%d%d",&n,&K);
    rep(i,0,n)scanf("%d",&a[i].x),a[i].y=i,b[i]=a[i].x;
    sort(a,a+n);
    ll ans=0;
    rep(i,0,n)ans+=a[i].x;
    rep(k,1,n){
        if(1LL*k*K>=ans)break;
        ll sum=1LL*k*K;
        build(1,0,n-1);
        rep(j,0,n){
            int x=a[j].y,y;
            if(x>=k){
                y=query(x-k,x-1);
            }
            else{
                y=min(query(0,x-1),query(n-1-(k-x)+1,n-1));
            }
            if(y<inf)sum+=y;
            else sum+=b[x];
            upd(x,b[x]);
            if(sum>=ans)break;
        }
        Min(ans,sum);
    }
    printf("%lld\n",ans);
    //cerr<<1.*clock()/CLOCKS_PER_SEC<<"s\n";
    return 0;
}//*/

Measured memory_bytes: 256
N, A, B, C, D = map(int, input().split())
S = input()

flag = True
if "##" in S[A:max(C, D)]:
    flag = False
if C > D:
    if "..." not in S[B-2:D+1]:
        flag = False

if flag:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3572
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#define rep(i,n) for (int i = 0; i < (n);i++)
typedef long long ll;
using namespace std;
/*#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;*/


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

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

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

        String nk = sc.nextLine().trim();
        String S = sc.nextLine().trim();
        String[] segments = nk.split(" ");
        int N = Integer.parseInt(segments[0]);
        int K = Integer.parseInt(segments[1]);

        for (int i = 0; i < N; i++) {
            int offset = i == K - 1 ? 32 : 0;
            System.out.print((char)(offset + S.charAt(i)));
        }
        System.out.println();
    }
}


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

int main() {
  string s;
  while(getline(cin, s) && s != ".") {
    stack<char> sta;
    bool b = true;
    for(int i = 0; i < s.size(); i++) {
      char c = s[i];
      if((c == ')' || c == ']') && sta.empty()) {
	b = false;
	break;
      }

      if(c == '(' || c == '[') {
	sta.push(c);
      }
      else if(c == ')' || c == ']') {
	if(c == ')' && sta.top() != '(') b = false;
	if(c == ']' && sta.top() != '[') b = false;
	sta.pop();
      }
    }
    if(b && sta.empty()) cout << "yes" << endl;
    else cout << "no" << endl;
  }
}

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

int main() {
	int64_t n;
	cin >> n;
	vector<int64_t> v(n);
	for (int i = 0; i < n; i++)
		cin >> v.at(i); 
	cout << *min_element(v.begin(), v.end()) << ' ' << *max_element(v.begin(), v.end()) << ' ' << accumulate(v.begin(), v.end(), 0LL) << endl;
}




Measured memory_bytes: 3196
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <stack>
#include <vector>
#include <math.h>
#include <queue>

using namespace std;

int main(){

	int table[3],tyokkaku = 0,eikaku = 0,donkaku = 0;

	while(true){
		scanf("%d %d %d",&table[0],&table[1],&table[2]);

		for(int i = 1; i <=2; i++){
			for(int k =2; k >= i; k--){
				if(table[k] > table[k-1])swap(table[k],table[k-1]);
			}
		}

		if(table[0] + table[1] > table[2] && table[1]+table[2] > table[0] &&
				table[2] + table[0] > table[1]){
			if(table[0]*table[0] == table[1]*table[1]+table[2]*table[2])tyokkaku++;
			else if(table[0]*table[0] > table[1]*table[1]+table[2]*table[2]){
				donkaku++;
			}else{
				eikaku++;
			}
		}else{
			printf("%d %d %d %d\n",tyokkaku+eikaku+donkaku,tyokkaku,eikaku,donkaku);
			break;
		}
	}


    return 0;
}

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

using namespace std;
using ll = long long;

ll fac (ll n) {
  ll x = n*(n+1)/2;
  return x;
}

int main() {
  ll N;
  cin >> N;

  ll ans = 0;

  for (ll i = 1; i < N+1; i++) {
    ll G = fac(N/i);
    ans += i*G;
  }

  cout << ans << endl;
}


Measured memory_bytes: 3584
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char s[100005];
int main()
{
	int n,i,cnt=0;
	scanf("%d",&n);
	scanf("%s",s+1);
	for(i=1;i<=n;i++)
		if(s[i]!=s[i-1])
			cnt++;
	printf("%d",cnt);
}

Measured memory_bytes: 256
/**
 *    author:  tourist
 *    created: 23.09.2017 15:13:56       
**/
#include <bits/stdc++.h>

using namespace std;

string let = "RYGB";

int main() {
  int h, w, d;
  cin >> h >> w >> d;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      int x = ((i + j) % (2 * d) + (2 * d)) % (2 * d) / d;
      int y = ((i - j) % (2 * d) + (2 * d)) % (2 * d) / d;
      putchar(let[2 * x + y]);
    }
    putchar('\n');
  }
  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
inline int read(){
    int res=0;
    char c;
    bool zf=0;
    while(((c=getchar())<'0'||c>'9')&&c!= '-');
    if(c=='-')zf=1;
    else res=c-'0';
    while((c=getchar())>='0'&&c<='9')res=(res<<3)+(res<<1)+c-'0';
    if(zf)return -res;
    return res;
}
int _data[100005];
int Max,now,ans;
signed main(){
	int n=read(),c=read(),k=read();
	for(register int i=1;i<=n;i++){
		_data[i]=read();
	}
	sort(_data+1,_data+n+1);
	for(register int i=1;i<=n;i++){
		if(!now||Max<_data[i])Max=_data[i]+k,now=c-1,ans++;
		else now--;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 4084
#include <cstdio> 
using namespace std; //This makes the code much more cleaner

int main()
{
	
/*
	int a, b, c, d;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	int area = a*b;
	int areatwo = c*d;
		if (area>=areatwo)
		{
			printf("%d", area);
		}
		else
		{
			printf("%d",areatwo);
		}
		*/

	int a,b;
	scanf("%d %d", &a, &b);
	if (a==1 and b!=1)
	{

		printf("Alice");

	}
	else if (b == 1 and a!=1)
	{

		printf("Bob");

	}
	else if (a>b)
	{

		printf("Alice");

	}
	else if (a == b)
	{

		printf("Draw");
	}
	else
	{

		printf("Bob");
	}



	return 0;

}

Measured memory_bytes: 128
N= int(input())
h= list(map(int, input().split()))

dp=[0]*(N+1)

dp[0]= 0
dp[1]= abs(h[1]-h[0])

for i in range(2, N):
    # print((dp[i-1]+ abs(h[i]-h[i-1])))
    # print((dp[i-2]+ abs(h[i]-h[i-2])))
    # print()
    dp[i]= min( (dp[i-1]+ abs(h[i]-h[i-1])) , (dp[i-2]+ abs(h[i]-h[i-2])))
    # print(dp[i])

# print(dp)
print(dp[N-1])


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

int main() {
  int A, B;
  cin >> A >> B;
  
  if (A > B) {
    if (A - B > 1)
      cout << 2 * A - 1 << endl;
    else
      cout << A + B << endl;
  } else if (A < B) {
    if (B - A > 1)
      cout << 2 * B - 1 << endl;
    else
      cout << A + B << endl;
  } else {
    cout << A + B << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#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,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


int main() {
    string t;
    cin >> t;
    int n = t.length();
    string ans = "";
    rep(i, n) {
        if (t[i] == '?') ans += 'D';
        else ans += t[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3800
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin(), v.end()
#define inputv(v, n)                                                           \
    vl v;                                                                      \
    rep(i, n) {                                                                \
        ll x;                                                                  \
        cin >> x;                                                              \
        v.push_back(x);                                                        \
    }
bool chmin(ll& a, ll& b) { if (b < a) { a = b; return 1; } return 0; }
bool chmax(ll& a, ll& b) { if (b > a) { a = b; return 1; } return 0; }
const ll INF = 999999999999999;
const ll MOD = 1000000007;
const ll MAX_N = 500010;
ll a, b, c, d, e, f, p, t, x, y, z, q, m, n, r, h, k, w, l, ans;
int main(){
    cin >> w >> h;
    vl A;
    rep(i, w) {
        cin >> x;
        A.push_back(x * 10 + 1);
    }
    rep(i, h) {
        cin >> x;
        A.push_back(x * 10 + 2);
    }

    sort(all(A));
    a = h+1;
    b = w+1;
    rep(i, h + w) {
        if (A[i] % 10 == 1) {
            x = A[i] / 10;
            ans += x * a;
            b--;
        }
        else {
            x = A[i] / 10;
            ans += x * b;
            a--;
        }
    }
    
    cout<<ans<<endl;
}


Measured memory_bytes: 2420
NUM_CONTESTS = 26

def main():
    D = int(input())
    c_list = list(map(int, input().split()))
    s_list = [list(map(int, input().split())) for _ in range(D)]

    t_list = [int(input()) for _ in range(D)]
    v_list = calc_score_list(s_list, c_list, t_list)

    for v in v_list:
        print(v)


def calc_score_list(s_list, c_list, t_list):
    last = [-1 for _ in range(NUM_CONTESTS)]
    score_list = []
    score = 0
    for d, t in enumerate(t_list):
        last[t - 1] = d
        score += s_list[d][t - 1] - sum([c * (d - l) for c, l in zip(c_list, last)])
        score_list.append(score)
    return score_list



if __name__ == "__main__":
    main()


Measured memory_bytes: 9204
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	string  f = "Yes";
	if (n % 2 == 0)
	{
		int i;
		for (i = 0; i < s.length() / 2; i++)
		{
			if (s.at(i) != s.at(s.length() / 2 + i))
				f = "No";
		}
	}
	else
		f = "No";
	cout << f << endl;
	
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5+5;
const int mod = 1e9+7;
ll qpow(ll a,ll b){ll res=1;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll d[maxn],p[maxn],size[maxn],ans[maxn],jec[maxn];
int n;
vector<int>v[maxn];
void dfs1(int now,int pre)
{
    size[now]=1;
    d[now]=1;
    for(int i = 0;i < v[now].size();++i){
        int to = v[now][i];
        if(to==pre)continue;
        dfs1(to,now);
        size[now]+=size[to];
    }
    d[now] = jec[size[now]-1];
    for(int i = 0;i < v[now].size();++i){
        int to = v[now][i];
        if(to==pre)continue;
        d[now]=d[now]*d[to]%mod*qpow(jec[size[to]],mod-2)%mod;
    }
}
void dfs2(int now,int pre)
{
    ll tmp=1;
    if(now!=1)
    {
        tmp=ans[pre]*jec[size[now]]%mod*qpow(jec[n-1],mod-2)%mod*qpow(d[now],mod-2)%mod*jec[n-size[now]-1]%mod;
    }
    else {
        for(int i = 0;i < v[now].size();++i){
            int to = v[now][i];
            if(to==pre)continue;
            dfs2(to,now);
        }
        return ;
    }
    ans[now]=jec[n-1];
    ans[now]=ans[now]*tmp%mod*qpow(jec[n-size[now]],mod-2)%mod;
    for(int i = 0;i < v[now].size();++i){
        int to = v[now][i];
        if(to==pre)continue;
        ans[now]=ans[now]*d[to]%mod*qpow(jec[size[to]],mod-2)%mod;
    }
    for(int i = 0;i < v[now].size();++i){
        int to = v[now][i];
        if(to==pre)continue;
        dfs2(to,now);
    }
}
int main()
{
    scanf("%d",&n);
    jec[0]=1;
    for(int i = 1;i <= n;++i)jec[i]=jec[i-1]*i%mod;
    for(int i = 1;i < n;++i)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        v[a].push_back(b);
        v[b].push_back(a);
    }
    dfs1(1,0);
    ans[1]=d[1];
    dfs2(1,0);
    for(int i = 1;i <= n;++i)printf("%lld\n",ans[i]);
    return 0;
}


Measured memory_bytes: 21748
use proconio::input;

fn main() {
    input! {
        n: usize,
        q: usize,
        a: [usize; n],
    }

    let mut t = FenwickTree::from_vec(a);
    for _ in 0..q {
        input! {
            f: u8,
            l: usize,
            r: usize,
        };
        if f == 0 {
            t.add(l, r);
        } else {
            println!("{}", t.sum(l, r));
        }
    }
}

struct FenwickTree<T> {
    v: Vec<T>,
}

use std::ops::AddAssign;
use num::{Integer, zero};

impl<T: Copy + AddAssign + Integer> FenwickTree<T> {
    fn new(n: usize) -> Self {
        Self {
            v: vec![zero(); n],
        }
    }

    fn from_vec(v: Vec<T>) -> Self {
        let n = v.len();
        let mut t = Self::new(n);
        for i in 0..n {
            let v = t.v[i] + v[i];
            t.v[i] = v;
            let p = i + Self::lsb(i + 1);
            if p < n {
                t.v[p] += v;
            }
        }
        t
    }

    fn add(&mut self, mut i: usize, v: T) {
        while i < self.v.len() {
            self.v[i] += v;
            i += Self::lsb(i + 1);
        }
    }

    fn sum(&self, l: usize, r: usize) -> T {
        assert!(l <= r && r <= self.v.len());

        self.get(r) - self.get(l)
    }

    fn get(&self, mut i: usize) -> T {
        let mut v = zero();
        while i > 0 {
            v += self.v[i - 1];
            i -= Self::lsb(i);
        }
        v
    }

    fn lsb(i: usize) -> usize {
        i & i.wrapping_neg()
    }
}


Measured memory_bytes: 23012
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define ll int64_t
#define _GLIBCXX_DEBUG
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
//約数列挙(√N)
vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}
//素因数分解(√N)
map< int64_t, int > prime_factor(int64_t n) {
  map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}
//素数テーブル(NloglogN)
vector< bool > prime_table(int n) {
  vector< bool > prime(n + 1, true);
  if(n >= 0) prime[0] = false;
  if(n >= 1) prime[1] = false;
  for(int i = 2; i * i <= n; i++) {
    if(!prime[i]) continue;
    for(int j = i + i; j <= n; j += i) {
      prime[j] = false;
    }
  }
  return prime;
}
//二項係数(K)
template< typename T >
T binomial(int64_t N, int64_t K) {
  if(K < 0 || N < K) return 0;
  T ret = 1;
  for(T i = 1; i <= K; ++i) {
    ret *= N--;
    ret /= i;
  }
  return ret;
}
//二項係数テーブル(N^2)
template< typename T >
vector< vector< T > > binomial_table(int N) {
  vector< vector< T > > mat(N + 1, vector< T >(N + 1));
  for(int i = 0; i <= N; i++) {
    for(int j = 0; j <= i; j++) {
      if(j == 0 || j == i) mat[i][j] = 1;
      else mat[i][j] = mat[i - 1][j - 1] + mat[i - 1][j];
    }
  }
  return mat;
}
int main(){
  int a,b,c,d,e;
  cin >> a >> b >> c >> d >> e;
  if(a==0)
    cout << 1 << endl;
  else if(b==0)
    cout << 2 << endl;
  else if(c==0)
        cout << 3 << endl;
  else if(d==0)
    cout << 4 << endl;
  else if(e==0)
    cout << 5 << endl;
}
  

Measured memory_bytes: 3600
def sumXOR(arr, n):       
    MOD = 10 ** 9 + 7
    sum = 0
    for i in range(0, 61): 
        zc = 0
        oc = 0
        idsum = 0
        for j in range(0, n): 
            if (arr[j] % 2 == 0): 
                zc = zc + 1                  
            else: 
                oc = oc + 1
            arr[j] = arr[j] // 2 
          
        idsum = oc * zc * (1 << i)    
        sum = (sum + idsum) % MOD;        
    return sum

n = int(input())
A = list(map(int, input().split()))
sum = 0
sum = sumXOR(A, n); 
print(sum) 


Measured memory_bytes: 125624
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"
 
using namespace std;

int main() {
  int N, x; cin >> N >> x;
  vector<int> a(N);
  for (auto &i : a) cin >> i;
  
  sort(a.begin(), a.end());
  
  int ans = 0;
  for (int i=0; i<N; i++) {
    x -= a[i];
    if (x < 0) break;
    else ans++;
  }
  if (x > 0) ans--;
  cout << ans << endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
using namespace std;
typedef long long ll;


int main(int argc, char *args[]) {
	int N, A, B;
	int sum;
	int num;
	int counter;
	counter = 0;
	cin >> N >> A >> B;
	for (int i = 1; i <= N; i++) {
		num = i;
		sum = 0;
		sum = sum + num / 10000;
		num = num - (num / 10000)*10000;
		sum = sum + num / 1000;
		num = num - (num / 1000) * 1000;
		sum = sum + num / 100;
		num = num - (num / 100) * 100;
		sum = sum + num / 10;
		num = num - (num / 10) * 10;
		sum = sum + num;
		if (sum <= B&&sum >= A) {
			counter = counter + i;
		}
	}
	cout << counter << endl;
	
	
}


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

using namespace std;

void solve(void)
{
	int h, w;
	cin >> h >> w;
	vector<string> grid(h);
	for (int i = 0; i < h; i++)
	{
		cin >> grid[i];
	}
	vector<int> dis(h * w, -1);
	queue<int> q;
	for (int i = 0; i < h; i++)
		for (int j = 0; j < w; j++)
		{
			if (grid[i][j] == '#')
			{
				dis[i*w+j] = 0;
				q.push(i * w + j);
			}
		}
	int d[] = {0, 1, 0, -1};
	while (!q.empty())
	{
		int y = q.front() / w, x = q.front() % w;
		q.pop();
		for (int i = 0; i < 4; i++)
		{
			int ny = y + d[i], nx = x + d[i ^ 1];
			if (0 <= ny && ny < h && 0 <= nx && nx < w)
			{
				if (dis[ny*w+nx] == -1)
				{
					dis[ny * w + nx] = dis[y * w + x] + 1;
					q.push(ny * w + nx);
				}
			}
		}
	}
	cout << *max_element(dis.begin(), dis.end()) << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


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

int main() {
	int n;
	cin >> n;
	vector<pair<int64_t,int64_t>> t;
	for (int i = 0; i < n; ++i) {
		int64_t ti, ai;
		cin >> ti >> ai;
		t.push_back(make_pair(ti, ai));
	}

	auto p = t[0];
	for (int i = 1; i < t.size(); ++i) {
		auto pn = t[i];
		int64_t mul1 = p.first / pn.first;
		int64_t mul2 = p.second / pn.second;
		if (p.first % pn.first != 0)
			mul1++;
		if (p.second % pn.second != 0)
			mul2++;
		int64_t mul = max((int64_t)1, max(mul1, mul2));
		pn.first *= mul;
		pn.second *= mul;
		p = pn;
	}
	cout << p.first + p.second << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    string s;
    cin>>s;
    int ans=0;

    for(int i=0;i<4;i++){
        if(s[i]=='+'){
            ans++;
        }
        else{
            ans--;
        }
    }

        cout<<ans<<endl;
    
}

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

template<typename T>
struct CumulativeSum2D {
    vector<vector<T>> acc;
    CumulativeSum2D(int h = 0, int w = 0) : acc(h + 2, vector<T>(w + 2)) { }
    void add(int i, int j, T x) { acc[i + 1][j + 1] += x; }
    void build() {
        int h = acc.size(), w = acc[0].size();
        for (int i = 1; i < h; i++) for (int j = 1; j < w; j++) {
            acc[i][j] += acc[i][j - 1] + acc[i - 1][j] - acc[i - 1][j - 1];
        }
    }
    T sum(int si, int ti, int sj, int tj) {     // [si, ti) x [sj, tj)
        return acc[ti][tj] - acc[si][tj] - acc[ti][sj] + acc[si][sj];
    }
};

int main() {
    int n, m; cin >> n >> m;
    int q; cin >> q;
    CumulativeSum2D<int> acc(n, n);
    while (m--) {
        int l, r; cin >> l >> r;
        acc.add(l, r, 1);
    }
    acc.build();
    while (q--) {
        int l, r; cin >> l >> r;
        cout << acc.sum(l, r + 1, l, r + 1) << endl;
    }
    return 0;
}


Measured memory_bytes: 1920
#include<stdio.h>
int main(){
    int x,y,z;
    while(1){
        scanf("%d %d",&x,&y);
        if(x == 0 && y == 0){
            break;
        }
        else if(x <= y){
            printf("%d %d\n",x,y);
        }
        else if(x > y){
            printf("%d %d\n",y,x);
        }

    }
    return 0;
}

Measured memory_bytes: 600
#import <Foundation/Foundation.h>
typedef long long Int;
int main() {
	Int N;
	scanf("%lld",&N);
	Int *A = (Int*)malloc(N*sizeof(Int));
	Int *L = (Int*)malloc(N*sizeof(Int));
	for(Int i=0;i<N;i++){
		scanf("%lld",A+i);
		if(i==0) L[i] = A[i];
		else L[i] = MAX(L[i-1],A[i]);
	}
	Int *R = (Int*)malloc(N*sizeof(Int));
	for(Int i=N-1;i>=0;i--){
		if(i==N-1) R[i] = A[i];
		else R[i] = MAX(R[i+1],A[i]);
	}
	for(Int i=0;i<N;i++){
		printf("%lld\n", i==0 ? R[1] : i==N-1 ? L[N-2] : MAX(L[i-1],R[i+1]));
	}
}

Measured memory_bytes: 8180
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
using namespace std;
int N;
vector<double>calc(vector<int>x,vector<int>d)
{
	int eqmax=-1e9,eqmin=1e9,upmax=-1e9,upmin=1e9,downmax=-1e9,downmin=1e9;
	for(int i=0;i<N;i++)
	{
		if(d[i]==0)
		{
			eqmax=max(eqmax,x[i]);
			eqmin=min(eqmin,x[i]);
		}
		else if(d[i]==1)
		{
			upmax=max(upmax,x[i]);
			upmin=min(upmin,x[i]);
		}
		else
		{
			downmax=max(downmax,x[i]);
			downmin=min(downmin,x[i]);
		}
	}
	vector<double>ret;
	ret.push_back(0);
	if(eqmax>-1e9)
	{
		if(eqmax<downmax)
		{
			if(upmax>-1e9)
			{
				if(upmax<downmax)
				{
					double mit=(downmax-upmax)/2.0;
					if(downmax-mit<eqmax)
					{
						ret.push_back(downmax-eqmax);
						ret.push_back(eqmax-upmax);
					}
					else
					{
						ret.push_back(mit);
					}
				}
			}
			else
			{
				ret.push_back(downmax-eqmax);
			}
		}
		else
		{
			if(upmax>-1e9)
			{
				if(eqmax>upmax)
				{
					ret.push_back(eqmax-upmax);
				}
			}
		}
	}
	else
	{
		if(downmax>-1e9)
		{
			if(upmax>-1e9)
			{
				if(upmax<downmax)
				{
					ret.push_back((downmax-upmax)/2.0);
				}
			}
		}
	}
	if(eqmin<1e9)
	{
		if(eqmin>upmin)
		{
			if(downmin<1e9)
			{
				if(downmin>upmin)
				{
					double mit=(downmin-upmin)/2.0;
					if(downmin-mit>eqmin)
					{
						ret.push_back(eqmin-upmin);
						ret.push_back(downmin-eqmin);
					}
					else
					{
						ret.push_back(mit);
					}
				}
			}
			else
			{
				ret.push_back(eqmin-upmin);
			}
		}
		else
		{
			if(downmin<1e9)
			{
				if(eqmin<downmin)
				{
					ret.push_back(downmin-eqmin);
				}
			}
		}
	}
	else
	{
		if(upmin<1e9)
		{
			if(downmin<1e9)
			{
				if(upmin<downmin)
				{
					ret.push_back((downmin-upmin)/2.0);
				}
			}
		}
	}
	return ret;
}
main()
{
	cin>>N;
	vector<int>x,y;
	vector<char>d;
	for(int i=0;i<N;i++)
	{
		int a,b;char c;cin>>a>>b>>c;
		x.push_back(a);
		y.push_back(b);
		d.push_back(c);
	}
	vector<int>E(N);
	for(int i=0;i<N;i++)
	{
		E[i]=d[i]=='L'?-1:d[i]=='R'?1:0;
	}
	vector<double>A=calc(x,E);
	for(int i=0;i<N;i++)
	{
		E[i]=d[i]=='D'?-1:d[i]=='U'?1:0;
	}
	vector<double>B=calc(y,E);
	vector<double>T;
	for(double p:A)T.push_back(p);
	for(double p:B)T.push_back(p);
	double ans=1e150;
	for(double nowt:T)
	{
		double xm=1e150,xM=-1e150,ym=1e150,yM=-1e150;
		for(int i=0;i<N;i++)
		{
			xm=min(xm,nowt*(d[i]=='L'?-1:d[i]=='R'?1:0)+x[i]);
			xM=max(xM,nowt*(d[i]=='L'?-1:d[i]=='R'?1:0)+x[i]);
			ym=min(ym,nowt*(d[i]=='D'?-1:d[i]=='U'?1:0)+y[i]);
			yM=max(yM,nowt*(d[i]=='D'?-1:d[i]=='U'?1:0)+y[i]);
		}
		ans=min(ans,(xM-xm)*(yM-ym));
	}
	cout<<fixed<<setprecision(9)<<ans<<endl;
}


Measured memory_bytes: 2420
using System;

class Program
{
  static void Main(string[] args)
  {
    int n = int.Parse(Console.ReadLine());
    int k = int.Parse(Console.ReadLine());
    int x = int.Parse(Console.ReadLine());
    int y = int.Parse(Console.ReadLine());
    
    if(n <= k) Console.WriteLine(x * n);
    else Console.WriteLine(x * k + y * (n - k));
  }
}

Measured memory_bytes: 13140
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T, class U> inline bool chmax(T& a,U b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class U> inline bool chmin(T& a,U b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    double l;
    cin >> l;
    double r = l / 3;
    double ans = r * r * r;
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	int N,Sum=0;
	cin >> N ;
	vector<int> taste(N);
  for (size_t i = 0; i < N; i++)
	{
		cin >> taste.at(i);
	}
	for (size_t i = 0; i < N; i++)
	{
		for (size_t j = 0; j < N; j++)
		{
			if (i!=j)
			{
				Sum += taste.at(i) * taste.at(j);
			}
		}
	}
	Sum =Sum/2;
	cout << Sum<<endl;

}

Measured memory_bytes: 256
takoyaki_len = int(input())
takoyaki_good = input().split()
recovery = 0

i = 0
while (i < takoyaki_len):
    j = i+1
    while (j < takoyaki_len):
        recovery += int(takoyaki_good[i]) * int(takoyaki_good[j])
        j += 1
    i += 1

print(recovery)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
// debug
#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl;
#define ddd(x, y, z) cerr << "(" #x "," #y "," #z "):(" << x << "," << y << "," << z << ")" << endl;
#define dump(v) cerr<<#v":[ ";for (auto macro_vi:v){cerr<<macro_vi<< " ";}cerr<<"]"<<endl;
#define ddump(v) cerr<<#v":"<<endl;for(auto macro_row:v) {cerr<<"["; for (auto macro__vi:macro_row){cerr<<macro__vi<< " ";}cerr<<"]"<<endl;}
#define damp(m) for(auto macro_pair:m){cerr<< macro_pair.first<<":"<<macro_pair.second<<endl;}
#define dpair(p) cerr << #p":"<<"(" << p.first << "," << p.second << ")" << endl;
// iterate
#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define reprrev(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define reprev(i, n) reprrev(i, 0, n)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define all(v) v.begin(), v.end()
// etc
#define chmin(mi, val) mi = min(mi, val);
#define chmax(ma, val) ma = max(ma, val);
using ll = long long;

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<ll> A(n, 0);
    priority_queue<ll> que;
    rep(i,n){
        ll tmp;
        cin >> tmp;
        que.push(tmp);
    }
    rep(i,m){
        int g = que.top();que.pop();
        que.push(g/2);
    }
    ll sum = 0;
    rep(i,n){
        sum+=que.top(); que.pop();
    }
    cout << sum << endl;
    return 0;
}


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

typedef long long ll;

int main()
{
    ll S;
    scanf("%lld", &S);
    ll BIG = 1e9;
    printf("0 0 ");
    if (S == BIG * BIG)
        printf("%lld 0 0 %lld", BIG, BIG);
    else
    {
        ll x1 = S / BIG + 1;
        ll y2 = BIG;
        ll x2 = x1 * y2 - S;
        ll y1 = 1;

        printf("%lld %lld %lld %lld", x1, y1, x2, y2);
    }
}


Measured memory_bytes: 256