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

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define sint int32_t
#define int long long int
#define all(v) v.begin() , v.end()
#define vii vector<int>
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int32_t main()
{   fastio;

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

}

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

t_now = 0
x_now = 0
y_now = 0

for _ in range(n):
    t,x,y = map(int,input().split())
    dist = x+y - (x_now + y_now)
    time = t - t_now
    if dist<=time and (time-dist)%2 == 0:
        t_now,x_now,y_now = t,x,y
        continue
    else:
        print('No')
        break
else:
    print('Yes')

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

    public String next() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public String nextLine() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          return reader.readLine();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      return tokenizer.nextToken("\n");
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }

    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    int n = sc.nextInt();
    int[] a = sc.nextIntArray(n);
    Set<Integer> set = new HashSet<>();
    for (int val : a) set.add(val);
    System.out.println(set.size() == n ? "YES" : "NO");
  }
}

Measured memory_bytes: 56628
#include<cstdio>
#include<algorithm>
using namespace std;
int ocnt[3001][3001]={0},kcnt[3001][3001]={0};
char s[3000][3001];
int main(void)
{
	int h,w,i,j,cnto,cntk;
	long long sum;
	scanf("%d %d",&h,&w);
	for(i=0;i<h;i++){
		scanf("%s",s[i]);
	}
	for(i=0;i<h;i++){
		cnto=0;
		for(j=w-1;j>0;j--){
			if(s[i][j]=='O'){
				cnto++;
			}
			ocnt[i][j-1]+=cnto;
		}
	}
	for(i=0;i<w;i++){
		cntk=0;
		for(j=h-1;j>0;j--){
			if(s[j][i]=='I'){
				cntk++;
			}
			kcnt[j-1][i]+=cntk;
		}
	}
	sum=0;
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(s[i][j]=='J'){
				sum+=(long long)kcnt[i][j]*ocnt[i][j];
			}
		}
	}
	printf("%lld\n",sum);
	return 0;
}


Measured memory_bytes: 81804
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(ll i=a;i<=b;i++)
#define FORD(i,a,b) for(ll i=a;i>=b;i--)
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define PB push_back
#define MP make_pair
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define sqr(x)  ((x) * (x)) 
#define cub(x)  ((x) * (x) * (x))
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; }
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
// ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  string s; cin >> s;
  if(s.length()==2){
    if(s[0]==s[1]){
      cout << "1 2" << endl;
      return 0;
    } else {
      cout << "-1 -1" << endl;
      return 0;
    }
  }

  FOR(i,0,s.length()-3){
    if(s[i]==s[i+1]){
      cout << i+1 << " " << i+2 << endl;
      return 0;
    } else if(s[i]==s[i+2]){
      cout << i+1 << " " << i+3 << endl;
      return 0;
    }
  }
  if(s[s.length()-2]==s[s.length()-1]){
    cout << s.length()-1 << " " << s.length() << endl;
    return 0;
  }

  cout << "-1 -1" << endl;
}


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

int main(){
  int x; cin >> x;
  if(x >= 30) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3620
/// @file
/// @copyright 2018 thousand
#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::max_element;
using std::string;
using std::stringstream;
using std::vector;

namespace {
int N;
class Ints : public vector<int> {
 public:
  string str();
};
class Intss : public vector<Ints> {
 public:
  string str(string delimiter);
};
class Intsss : public vector<Intss> {
 public:
  string str();
};
string Ints::str() {
  stringstream ss;
  for (auto it = this->begin(); it != this->end(); ++it) {
    ss << *it;
    if (it != this->end() - 1) ss << " ";
  }
  return ss.str();
}
string Intss::str(string delimiter="\n") {
  stringstream ss;
  for (auto it = this->begin(); it != this->end(); ++it) {
    ss << it->str();
    if (it != this->end() - 1) ss << delimiter;
  }
  return ss.str();
}
string Intsss::str() {
  stringstream ss;
  for (auto it = this->begin(); it != this->end(); ++it) {
    ss << it->str(" ");
    if (it != this->end() - 1) ss << endl;
  }
  return ss.str();
}
Intsss F;
Intss P;
void GetInput() {
  cin >> N;
  for (int i = 1; i <= N; ++i) {
    Intss intss;
    for (int j = 1; j <= 5; ++j) {
      Ints ints;
      for (int k = 1; k <= 2; ++k) {
        ints.push_back(-1);
        cin >> *--ints.end();
      }
      intss.push_back(ints);
    }
    F.push_back(intss);
  }
//  cout << F.str() << endl;
  for (int i = 1; i <= N; ++i) {
    Ints ints;
    for (int j = 0; j <= 10; ++j) {
      ints.push_back(-1);
      cin >> *--ints.end();
    }
    P.push_back(ints);
  }
//  cout << P.str() << endl;
}
void Solve() {
  Ints profits;
  for (int b = 1; b <= 1023; ++b) {  // for each case.
    int P_sum = 0;
    for (int i = 0; i < N; ++i) {
      // "Let c_i be the number of periods during which both Shop i"
      // "and Joisino's shop are open."
      int c_i = 0;
      for (int j = 0; j < 5; ++j) {
        for (int k = 0; k < 2; ++k) {
          bool open_shop_i = F[i][j][k];
          bool open_Joisino = (b >> (2 * j + k) & 1);
          if (open_shop_i && open_Joisino) ++c_i;
        }
      }
      P_sum += P[i][c_i];
    }
    profits.push_back(P_sum);
  }
  cout << *max_element(profits.begin(), profits.end()) << endl;
}
}  // namespace

int main() {
  GetInput();
  Solve();
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>

using namespace std;
string st;
long long s;
int main()
{
	cin>>st;
	for(int i=0;i<st.size();i++)
	{
		s++;
	}
	cout<<st[0]<<s-2<<st[s-1];
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int h, w;
    cin >> h >> w;
    vector<int> a, b;
    for (int i = 0; i < h; ++i) {
        string s;
        cin >> s;
        for (int j = 0; j < w; ++j) {
            if(s[j] == 'B'){
                a.emplace_back(i+j);
                b.emplace_back(i-j);
            }
        }
    }
    auto P = minmax_element(a.begin(),a.end()), Q = minmax_element(b.begin(),b.end());
    cout << max(*P.second-*P.first, *Q.second-*Q.first) << "\n";
    return 0;
}


Measured memory_bytes: 9020
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int> >;
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(int i = m; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
typedef long long ll;
const int INF = 2000000000;
const ll INF64 = 9223372036854775806ll;
const int mod = 1000000007ll;
const ll  MOD = 1000000007LL;
/*メモ 
*/
int main(){
    int n;
    std::cin >> n;
    int k;
    std::cin >> k;
    VEC(int,a,n);
    int ans=0;
    rep(i,n){
        ans+=2*min(abs(k-a[i]),a[i]);
    }
    std::cout << ans << std::endl;
}



Measured memory_bytes: 256
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=pow(10,9)+7

h,w=map(int,input().split())
s=[input() for i in range(h)]
d=[[1,0],[0,1],[-1,0],[0,-1]]

whitecnt=0
for i in range(h):
    for j in range(w):
        if s[i][j]==".":
            whitecnt+=1
grid=[[0]*w for i in range(h)]
grid[0][0]=1
q=deque([[0,0,1]])
while q:
    x,y,dist=q.popleft()
    for xd, yd in d:
        if 0<=x+xd<w and 0<=y+yd<h and grid[y+yd][x+xd]==0 and s[y+yd][x+xd]==".":
            if x+xd==w-1 and y+yd==h-1:
                print(whitecnt-(dist+1))
                exit()
            # print(x+xd,y+yd)

            grid[y+yd][x+xd]=1
            q.append([x+xd,y+yd,dist+1])
# print(grid)
print(-1)


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

const int maxn = 200010;
int n,flag,sum;

struct node
{
    int a,b;
}job[maxn];

bool compare(node x, node y)
{
    return x.b < y.b;
}

int main()
{
    scanf("%d",&n);
    flag = 0;
    for(int i = 0; i < n; i++)
    {
        scanf("%d %d",&job[i].a,&job[i].b);
        if(job[i].a>job[i].b)
            flag = 1;
    }
    sort(job,job+n,compare);
    sum = 0;
    for(int i = 0; i < n; i++)
    {
        sum += job[i].a;
        if(sum > job[i].b)
        {
            flag = 1;
            break;
        }
    }
    if(flag)
        printf("No\n");
    else
        printf("Yes\n");
}


Measured memory_bytes: 1792
w=input()
n=input()
A=[ i+1 for i in range(w)]

for i in range(n):
	a,b=map(int, raw_input().split(","))
	ta=A[a-1]
	tb=A[b-1]
	A[a-1]=tb
	A[b-1]=ta

for i in A:
	print i


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

#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int x, t;
    cin >> x >> t;
    if(x>t) cout << x-t << endl;
    else cout << 0 << endl;
    return 0;
}

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

using ll = long long;
#define REP(i, n) for(int (i)=0; (i)< (n); ++i)
#define REPR(i, n) for(int (i)=(n); (i)>=0; --i)
#define FOR(i, n, m) for(int (i)=(n); (i)<(m); ++i)
constexpr int INF = 1e9;
//constexpr ll INF = 1LL << 62;
constexpr int mod = 1e9+7;

int dp[3005][6005];
int maxA[3005][6005];
int main(){
  int N, T;
  cin >> N >> T;
  vector<pair<int, int>> pr(N);
  vector<int> A(N), B(N);
  REP(i, N){
    cin >> pr[i].first >> pr[i].second;
  }
  sort(pr.begin(), pr.end());
  REP(i, N){
    A[i] = pr[i].first;
    B[i] = pr[i].second;
  }

  REP(i, N+1){
    FOR(j,1,  6005){
      maxA[i][j] = INF;
      dp[i][j] = -1;
    }
  }
  maxA[0][0] = 0;
  dp[0][0] = 0;
  REP(i, N){
    REP(j, T+1+3000){
      if(dp[i][j] == -1) continue;
      if(dp[i+1][j] < dp[i][j]){
        dp[i+1][j] = dp[i][j];
        maxA[i+1][j] = maxA[i][j];
      }
      else if(dp[i+1][j] == dp[i][j]){
        maxA[i+1][j] = max(maxA[i+1][j], maxA[i][j]);
      }
      if(j > T) continue;
      if(dp[i+1][j+A[i]] < dp[i][j] + B[i]){
        dp[i+1][j+A[i]] = dp[i][j] + B[i];
        maxA[i+1][j+A[i]] = max(maxA[i][j], A[i]);
      }
      else if(dp[i+1][j+A[i]] == dp[i][j] + B[i]){
        maxA[i+1][j+A[i]] = max(maxA[i+1][j+A[i]], max(maxA[i][j], A[i]));
      }
    }
  }
  int ans = 0;
  REP(i, 6005){
    if(maxA[N][i] != INF && i-maxA[N][i] < T){
      ans = max(ans, dp[N][i]);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 141184
import numpy as np

N, W = map(int, input().split())
w = np.empty(N, dtype = np.int64)
v = np.empty(N, dtype = np.int64)
for i in range(N):
	w[i], v[i] = map(int, input().split())

dp = np.zeros(W + 1, dtype = np.int64)

for i in range(N):
	dp[w[i]:] = np.maximum(dp[w[i]:], dp[:W - w[i] + 1] + v[i])

print(dp.max())

Measured memory_bytes: 29992
#include <bits/stdc++.h>
 
using namespace std;
 
const long long MOD=1e9+7;
const double PI=3.14159265359;
 
 
int main() {
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    int a,b,c,d,e,f;
    
    cin>>a>>b>>c>>d>>e>>f;
    
    vector<int> dp(f+1,-MOD);
    dp[0]=0;
    
    
    for(int i=0; i<=f; i++){
        if(i-100*a>=0){
            dp[i]=max(dp[i],dp[i-100*a]);
        }
        if(i-100*b>=0){
            dp[i]=max(dp[i],dp[i-100*b]);
        }
        if(i-c>0){
            if((dp[i-c]+c)*(100+e)<=e*(i)){
                dp[i]=max(dp[i],dp[i-c]+c);
            }
        }
        if(i-d>0){
            if((dp[i-d]+d)*(100+e)<=e*(i)){
                dp[i]=max(dp[i],dp[i-d]+d);
            }
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
    int ans=0, ans2=100*a;
    for(int i=0; i<=f; i++){
        if(dp[i]>0 && i*ans<dp[i]*ans2){
            ans=dp[i], ans2=i;
        }
    }
    cout<<ans2<<" "<<ans;
    
    
    
    return 0;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <tuple>
#include <cstring>

#define INF 100000000

using namespace std;

int main()
{
    /*
    int h,w;
    cin >> h >> w;
    char s[h][w];
    for (int i = 1;i<=h;i++)
    {
        for(int j = 1;j<=w;j++)
        {
            cin >> s[i][j];
        }
    }

    char ans[h+2][w+2] = {0};
    int dx[8] = {0,-1,0,1,1,-1,1,-1},dy[8] = {-1,0,1,0,1,-1,-1,1};

    for(int i = 1;i<=h;i++)
    {
        for(int j = 1;j<=w;j++)
        {
            if(s[i][j] == '#')
            {
                ans[i][j] = '#';
                for(int p = 0;p<8;p++)
                {
                    if(ans[i+dx[p]][j+dy[p]] == '#')
                    continue;
                    else{
                        ans[i+dx[p]][j+dy[p]] ++;
                    }
                }
            }
        }
    }
    for(int i = 1;i<=h;i++)
    {
        for(int j = 1;j<=w;j++)
        {
            cout << ans[i][j];
        }
        cout << "\n";
    }
    return 0;
    */

    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int x3 = x2 + y1 - y2;
    int y3 = y2 - x1 + x2;
    int x4 = x3 + x1 - x2;
    int y4 = y3 + y1 - y2;
    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 2019;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
 
void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}
 
int main(){
  
  ll H,W,p;
  cin>>H>>W;
  
  char field[60][60];
  // make field
  for (int i=1; i<=H;i++){
    for(int j=1; j<=W;j++){
      cin>>field[i][j];
    }
  }
  // count black tile
  
  ll count=0;
  for (int i=1; i<=H;i++){
    for(int j=1; j<=W;j++){
      if(field[i][j]=='#')
        count++;
    }
  }
  
  
  ll dis[60][60];
  
  //dis 初期化 
  for (int i=1; i<=H;i++){
    for(int j=1; j<=W;j++){
      dis[i][j]=INF;
    }
  }
  
  queue<P> que;
  vector<int> dx={-1,0,0,1};
  vector<int> dy={0,-1,1,0};
  
  //初期条件
  dis[1][1]=0;
  que.push({1,1});
  
  //BFS start
  
  while(!que.empty()){
    P v=que.front();
    que.pop();
    int x=v.first;
    int y=v.second;
    rep (i,4){
      int nx=x+dx[i];
      int ny=y+dy[i];
      if(nx>0 && nx<=H && ny>0 && ny<=W){
        if (field[nx][ny]=='#') continue;
        if (dis[nx][ny]!=INF) continue;
        else{
          dis[nx][ny]=dis[x][y]+1;
          que.push({nx,ny});
        }
      }
    }
  }
  p=dis[H][W];
  
  if(p==INF)
    cout<<-1<<endl;
  else{
    ll ans;
    ans=H*W-(p+1)-count;
    cout<<ans<<endl;
  }
}

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

int main(){
  int M,N;
  int t = 0;
  cin >> N;
  M = N;
  while(N>0){
    t += N%10;
    N = N/10;
  }
  if(M%t==0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

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

#define int long long
#define endl '\n'
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define DESYNC ios::sync_with_stdio(0); cin.tie(0);
#define deb(x) cerr << ">> " << #x << " : " << x << "\n";
#define print(a) for(auto x : a) cout << x << " "; cout << "\n";

const int inf = 1e18 + 5;

// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

void solve()
{
    int h;
    cin >> h;
    int ans = 0;
    int k = 1;
    while(h)
    {
        ans += k;
        h /= 2;
        k *= 2;
    }
    cout << ans << endl;
}

int32_t main()
{
    DESYNC
    int t = 1;
    // cin >> t;
    while(t--)
        solve();
    return 0;
}

Measured memory_bytes: 3636
import math

N = int(input())
Alist = [int(x) for x in input().split()]

result = 1
for A in Alist:
  result *= A
  if result > 1000000000000000000:
    if 0 in Alist:
      result = 0
    break

if result > 1000000000000000000:
  print("-1")
else:
  print(result)

Measured memory_bytes: 22468
//どうかACをお恵みくださいお願いしますお願いしますお願います何もしませんから
using System;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            long N = long.Parse(Console.ReadLine());
            Console.WriteLine(((N - 1) * N) / 2);
        }
    }
}

Measured memory_bytes: 27296
#include <iostream>
#include<math.h>

using namespace std;


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


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

    int counter = 0;
    while(true) {

        bool isEvenAll = true;
        for (int i = 0; i < N; ++i) {
            if (A[i] % 2 == 0) {
                A[i] = A[i] / 2;
            } else {
                isEvenAll = false;
            }
        }

        if (isEvenAll) {
            ++counter;
        } else {
            break;
        }
    }
    cout << counter << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
	long long a,b,k;
	cin>>a>>b>>k;
	for(int i=1;i<=k;i++)
	{
		if(a%2!=0)
		{
			a-=1;
			b+=a/2;
			a-=a/2;
		}
		else
		{
			b+=a/2;
			a-=a/2;
		}
		//cout<<a<<" "<<b<<endl;
		 i++;
		 if(i>k) break;
		if(b%2!=0)
		{
			b-=1;
			a+=b/2;
			b-=b/2;
		}
		else
		{
		    a+=b/2;
		    b-=b/2;	
		}
		//cout<<a<<" "<<b<<endl;
	}
	cout<<a<<" "<<b<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<cstdint>
#include<bits/stdc++.h>
#include<queue>
#include<set>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((ll)(x).size())
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define INF bit(60)
#define pb push_back
#define mod 1000000007

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

using namespace std;
using uif=uint_fast64_t;
using ll=long long int;

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

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int main(void){

  ll n;
  cin>>n;

  vector<ll> p(n);

  rep(i,n) cin>>p[i];

  ll ans=0;

  rep(i,n){
    if(i==0 || i==n-1) continue;
    
    if( max({p[i-1],p[i],p[i+1]}) == p[i] ) continue;
    if( min({p[i-1],p[i],p[i+1]}) == p[i] ) continue;
    ans++;

  }

  cout << ans << endl;

  return 0;

}


Measured memory_bytes: 256
import java.util.*;


public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int x = Integer.parseInt(sc.next());
		if(x<1200){
			System.out.println("ABC");
		}else{
			System.out.println("ARC");
		}	
		sc.close();
	}
}

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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BStringPalindrome solver = new BStringPalindrome();
        solver.solve(1, in, out);
        out.close();
    }

    static class BStringPalindrome {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            StringBuilder sb = new StringBuilder(s);
            boolean ret = true;
            if (!sb.reverse().toString().equals(s)) ret = false;
            String s2 = s.substring(0, s.length() / 2);
            StringBuilder sb2 = new StringBuilder(s2);
            if (!sb2.reverse().toString().equals(s2)) ret = false;
            String s3 = s.substring(((s.length() + 3) / 2) - 1);
            StringBuilder sb3 = new StringBuilder(s3);
            if (!sb3.reverse().toString().equals(s3)) ret = false;

            out.println(ret ? "Yes" : "No");


        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

    }
}



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

using namespace std;

void solve()
{
    bool f[100001];
    int c[100002];
    for(int i = 0; i < 100001; i++) {
        f[i] = true;
        c[i] = 0;
    }
    f[1] = false;
    for(int i = 2; i <= 100000; i++){
        if(f[i]){
            for(int j = 2; i*j <= 100000; j++){
                f[i*j] = false;
            }
        }
    }
    for(int i = 1; i <= 100000; i+=2){
        if(f[i]&&f[(i+1)/2]) {
            c[i] = c[i-2] + 1;
        }
        else{
            c[i] = c[i-2];
        }
    }



    int Q;
    cin >> Q;
    int ans[Q];
    for(int i = 0; i < Q; i++){
        int l, r;
        cin >> l >> r;

        ans[i] = c[r] - c[max(l-2, 0)];
    }
    for(int i = 0; i < Q; i++){
        cout << ans[i] << endl;
    }
    return;
}

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


Measured memory_bytes: 1536
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
	string S;
	cin >> S;
	string ans = "Yes";
	for (int i = 0; i < S.size(); i++) {
		if ((i + 1) % 2 == 1 && S[i] == 'L') ans = "No";
		else if ((i + 1) % 2 == 0 && S[i] == 'R') ans = "No";
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3564
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
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;}

const int INF = 1<<29;
const int MAX = 1000000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
  int x, y; cin >> x >> y;
  if ((x + y) % 3 != 0) cout << 0 << endl;
  else{
    ll n = (2 * x - y) / 3;
    ll m = (2 * y - x) / 3;
    COMinit();
    cout << COM(n + m, n) << endl;
  }
}


Measured memory_bytes: 23680
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int stayDay = sc.nextInt();
		int hotelDay = sc.nextInt();
		int hotelPrice = sc.nextInt();
		int hotelPriceDiscount = sc.nextInt();

		int totalPrice = 0;

		if (stayDay <= hotelDay) {
			totalPrice = stayDay * hotelPrice;
		} else {
			totalPrice = (hotelDay * hotelPrice) + ((stayDay - hotelDay) * hotelPriceDiscount);
		}
		System.out.println(totalPrice);
	}
}


Measured memory_bytes: 21332
import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        if (s.equals("ABC")) {
            System.out.println("ARC");
        } else {
            System.out.println("ABC");
        }
        sc.close();
    }
}

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

const int N = 100005;

struct Edge {
	int u, v, w;

	Edge (int u, int v, int w) :
		u(u), v(v), w(w) {}

	bool operator < (const Edge& rhs) const {
		return w > rhs.w;
	}
};

int n, par[N];
long long res[N];
long long val[N];
vector<Edge> E;
vector<int> comp[N];

int find(int u) {
	return (u == par[u]) ? u : par[u] = find(par[u]);
}

void join(int u, int v, int w) {
	u = find(u), v = find(v);
	if (comp[u].size() > comp[v].size()) swap(u, v);
	int szu = comp[u].size(), szv = comp[v].size();
	val[v] += 1LL * szu * w;
	for (auto i : comp[u]) {
		res[i] += val[u] + 1LL * szv * w - val[v], comp[v].push_back(i);
	}
	val[u] = 0, comp[u].clear(), par[u] = v;
}

int main() {
	ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		par[i] = i, comp[i].push_back(i);
	}
	for (int i = 1; i < n; ++i) {
		int u, v, w; cin >> u >> v >> w;
		E.push_back(Edge(u, v, w));
	}
	sort(E.begin(), E.end());
	for (auto i : E) join(i.u, i.v, i.w);
	for (int i = 1; i <= n; ++i) {
		res[i] += val[find(i)]; cout << res[i] << '\n';
	}
}

Measured memory_bytes: 14068
#include<bits/stdc++.h>
using namespace std;
#define ll        long long
#define  sci(x)   scanf("%d", &x)
#define  scl(x)   scanf("%lld", &x)
#define  scd(x)   scanf("%lf", &x)
#define l0(i,n)   for(ll i=0; i<n; i++)

int main ()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	//CODE TONOY
	int x;
	cin>>x;
	int c500 = x/500;
 	int r500 = x%500;
 	int c5 = r500/5; 
	int y=c500*1000+c5*5;
	cout<<y<<endl;
			
	return 0;
}

Measured memory_bytes: 256
def main():
  n=int(input())
  a=sorted(list(map(int,input().split())))
  mod=pow(10,9)+7
  if n%2==0:
    b=[2*(i//2)+1 for i in range(n)]
    if  not all(a[i]==b[i] for i in range(n)):
      ans=0
    else:
      ans=pow(2,n//2,mod)
  else:
    b=[0]+[2*(i//2) for i in range(2,n+1)]
    if not all(a[i]==b[i] for i in range(n)):
      ans=0
    else:
      ans=pow(2,n//2,mod)
  print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 14008
//https://atcoder.jp/contests/abc087/tasks/arc090_b
//D - People on a Line
//重み付きunionfind (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_B&lang=jp)
#include <bits/stdc++.h>
using namespace std;
using ll=int64_t;
#define FOR(i,a,b) for(int64_t i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//重み付きUnion Find木
template<class T>
struct wuf_tree {
    std::vector<int> parent;
    std::vector<T> diff_weight;
    int __size;
    wuf_tree(int size_, T sum_unity=T()) : parent(size_, -1), diff_weight(size_,sum_unity), __size(size_) {}
    void unite(int x, int y, T w) {
        w += weight(x);
        w -= weight(y);
        if ((x = find(x)) != (y = find(y))) {
            if (parent[y] < parent[x]) { std::swap(x, y); w=-w; }
            parent[x] += parent[y];
            parent[y] = x;
            diff_weight[y] = w;
            __size--;
        }
    }
    bool is_same(int x, int y) { return find(x) == find(y); }
    int find(int x) {
        if (parent[x]<0) return x;
        int r = find(parent[x]);
        diff_weight[x] += diff_weight[parent[x]];
        return parent[x] = r;
    }
    int size(int x) { return -parent[find(x)]; }
    int size() const { return __size; }
    T weight(int x) { find(x); return diff_weight[x]; }
    T diff(int x, int y) { return weight(y) - weight(x); }
};

int main() {
#if LOCAL&01
    std::ifstream in("./test/sample-2.in"); //input.txt
    std::cin.rdbuf(in.rdbuf());
#else
    cin.tie(0);
    ios::sync_with_stdio(false);
#endif
    ll N,M; cin>>N>>M;    
    wuf_tree<ll> wuft(N+1);
    REP(i,M){
        ll l,r,d; cin>>l>>r>>d;
        if (wuft.is_same(l,r)){
            if (wuft.diff(l,r) != d) {
                cout<<"No"<<endl;
                return 0;
            }
        }
        wuft.unite(l,r,d);
    }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 1408
<?php
list($s) = strs();
$a = ['dreameraser', 'dreamerase', 'dreamer', 'dream', 'eraser', 'erase'];
$i = 0;
while ($i < strlen($s)) {
    foreach ($a as $v) {
        if ($v === substr($s, $i, strlen($v))) {
            $i += strlen($v);
            continue 2;
        }
    }
    exit('NO');
}
echo 'YES';
function strs()
{
    return explode(' ', trim(fgets(STDIN)));
}


Measured memory_bytes: 4728
#include <bits/stdc++.h>
#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr)
using namespace std;
signed main() {
    FAST_IO;
    string s1,s2;
    cin>>s1>>s2;
    int n1 = s1.length();
    int n2 = s2.length();
    int dp[n1+1][n2+1] = {0};
    for(int i=0;i<=n1;i++){
        for(int j=0;j<=n2;j++){
            if(i==0||j==0)
                dp[i][j]=0;
            else if(s1[i-1]==s2[j-1])
                dp[i][j] = 1 + dp[i-1][j-1];
            else
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
        }
    }
    int i = n1,j=n2;
    string s = "";
    while(i>0&&j>0){
        if(s1[i-1]==s2[j-1]){
            s = s1[i-1] + s;
            i--; j--;
        }
        else if(dp[i-1][j]>dp[i][j-1])
            i--;
        else
            j--; 
    }
    cout<<s;
    return 0;
}

Measured memory_bytes: 38744
/* 
 * Author: Pawan Mishra.
 * Everybody is awesome at something.
 */

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <fstream>
#include <cstring>
#include <unordered_map>
#include <map>

using namespace std;
typedef long long int ll;

// Macro //
#define X first
#define Y second
#define pii pair<int,int>
#define pll pair<ll,ll>

// Global //
#define N 1001
ll n, a[N][N];
unordered_map<ll, vector<ll> > graph;
map<ll, ll> inDeg;

// Functions //
void swap(ll * a, ll * b) {
    ll temp = *a;
    *a = *b;
    *b = temp;
}

ll hashVertices(ll a, ll b) {
    if (a > b) swap(a, b);
    return a*N + b;
}

pll reverseHash(ll x) {
    pll y;
    y.X = x / N;
    y.Y = x % N;
    return y;
}

// Main //
int main(int argc, char const *argv[])
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    
    /* code */
    cin >> n;
    for (ll i=0; i<n; i++)
        for (ll j=0; j<n-1; j++) {
            cin >> a[i][j];
            ll vertex = hashVertices(i+1, a[i][j]);
            inDeg[vertex] = 0;
        }

    for (ll i=0; i<n; i++) {
        ll prev = hashVertices(i+1, a[i][0]);
        for (ll j=1; j<n-1; j++) {
            ll curr = hashVertices(i+1, a[i][j]);
            graph[prev].push_back(curr);
            inDeg[curr]++;
            prev = curr;
        }
    }

    queue<ll> dayMatches[2];

    ll day = 0;
    for (auto it=inDeg.begin(); it!=inDeg.end(); ++it) {
        // pll y = reverseHash(it->first);
        // cout << y.X << ',' << y.Y << ' ';
        // cout << it->first << ' ' << it->second << endl;
        if (it->second == 0) dayMatches[day%2].push(it->first);
    }

    while (!dayMatches[(day)%2].empty() || !dayMatches[(day+1)%2].empty()) {
        while (!dayMatches[day%2].empty()) {
            ll curr = dayMatches[day%2].front();
            dayMatches[day%2].pop();

            for (ll i=0; i<graph[curr].size(); i++) {
                ll vertex = graph[curr][i];
                inDeg[vertex]--;
                if (inDeg[vertex]==0) dayMatches[(day+1)%2].push(vertex);
            }

            graph.erase(curr);
        }
        day++;
    }

    if (graph.empty()) cout << day << endl;
    else cout << -1 << endl;


    // for (auto it=inDeg.begin(); it!=inDeg.end(); ++it) {
    //     pll y = reverseHash(it->first);
    //     cout << y.X << ',' << y.Y << ' ';
    //     cout << it->first << ' ' << it->second << endl;
    // }

    // for (auto it=graph.begin(); it!=graph.end(); ++it) {
    //     cout << it->X << ": ";
    //     for (ll i=0; i<it->Y.size(); i++) {
    //         cout << it->Y[i] << ' ';
    //     }
    //     cout << endl;
    // }
    return 0;
}

Measured memory_bytes: 82420
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int N, W;
int w[110], v[110];
int minw = 1 << 30;
vector<int> v2[4];

ll dfs(int idx, int rem) {
  if (idx == 4) return 0;
  ll res = dfs(idx + 1, rem);
  ll sumv = 0;
  for (int i = 0; i < v2[idx].size(); i++) {
    sumv += v2[idx][i];
    if (rem - (i + 1) * (minw + idx) < 0) break;
    res = max(res, dfs(idx + 1, rem - (i + 1) * (minw + idx)) + sumv);
  }
  return res;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  cin >> N >> W;
  for (int i = 0; i < N; i++) {
    cin >> w[i] >> v[i];
    minw = min(minw, w[i]);
  }  
  for (int i = 0; i < N; i++) {
    v2[w[i] - minw].emplace_back(v[i]);
  }
  for (int i = 0; i < 4; i++) {
    sort(v2[i].rbegin(), v2[i].rend());
  }
  cout << dfs(0, W) << endl;

  return 0;
}

Measured memory_bytes: 256
N = int(input())
H = [int(i) for i in input().split()]
Min = min(H)
ans = Min
for i in range(N):
    H[i] -= Min
dif = []
pre = 0
for i in range(N):
    if pre!=H[i] and H[i]-pre>0:
        dif.append(H[i]-pre)
    else:
        dif.append(0)
    pre = H[i]

print(ans+sum(dif))


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

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		FastScanner sc=new FastScanner();
		long N=sc.nextLong();
		String ans="";
		--N;
		while (true) {
			ans=String.valueOf((char)('a'+N%26))+ans;
			N=N/26;
			if (N==0) break;
			--N;
		}
		//
		System.out.println(ans);
		
		//0,1,...,25,
		//26+0,26+1,...,
		
	}

	void tr(Object...o) {System.out.println(Arrays.deepToString(o));}
}

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


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



int main() {
	// your code goes here
	string a,b; cin >> a >> b; a+=b;
	int n=stoi(a);
	int counter=0;
	for(int i=1; i*i<=n; i++)
	{
	   if(n==i*i) {
	   	counter=1;
	   	break;
	   }	
	}
	if(counter) cout <<"Yes\n";
	else
	cout <<"No\n";
	return 0;
}

Measured memory_bytes: 256
/// Code By t_bone_289 (Tushar Singh)
/// An Immature Programmer.... I'm still developing !!
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
#define endl '\n'
#define M 1000000007
#define error(x) cout << #x << " = " << x << endl;
#define pi 3.14159265358979323846
typedef long long ll;
typedef double d;
typedef long double ld;
template <typename T>
void ContainerError(T &v){cout<<"{";for(auto &x:v){cout<<x<<',';}cout<<"}"<<endl;return;}
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
ll powmod(ll base,ll exp,ll MOD){ll res=1;while(exp>0){if(exp%2==1) res=(res*base)%MOD;base=(base*base)%MOD;exp/=2;}return (res%MOD);}
ll mpow(ll base,ll exp){ll res=1;while(exp>0){if(exp%2==1) res=(res*base);base=(base*base);exp/=2;}return (res);}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll MAX = 100000000000000000;
ll sol(ll i,ll j,vector<ll> &v,vector<vector<ll> > &dp)
{
    if(i==j)
    {
        return dp[i][j]=0;
    }
    if(dp[i][j]!=-1)
    {
        return dp[i][j];
    }
    ll ans = MAX;
    for(ll x=i;x<j;x++)
    {
        ans = min(ans,sol(i,x,v,dp) + sol(x+1,j,v,dp));
    }
    for(ll x=i;x<=j;x++)
    {
        ans+=v[x];
    }
    return dp[i][j]=ans;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin>>n;
    vector<ll> v(n);
    for(auto &x:v)
    {
        cin>>x;
    }
    vector<vector<ll> > dp(n+1,vector<ll>(n+1,0));
    for(ll sz=1;sz<=n;sz++)
    {
        ll i=0;
        ll j=sz-1;
        while(j<n)
        {
            ll temp = MAX;
            for(ll x=i;x<j;x++)
            {
                temp = min(temp,dp[i][x]+dp[x+1][j]);
            }
            for(ll x=i;x<=j;x++)
            {
                temp+=v[x];
            }
            dp[i][j]=temp;
            if(sz==1){dp[i][j]=0;}
            i++;
            j++;
        }
    }
    cout<<dp[0][n-1]<<endl;
    //ll ans = sol(0,n-1,v,dp);
    //cout<<ans;
    return 0;
}




Measured memory_bytes: 1536
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}

using Graph=vector<vector<int>>;
Graph G;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int>vec(n);
  int one=0;
  rep(i,n){
    cin>>vec[i];
    if(vec[i]==1)one++;
  }
  if(one==0){
    cout<<-1<<endl;
    return 0;
  }
  int now=1;
  int sum=0;
  rep(i,n){
    if(vec[i]!=now)sum++;
    else{
      now++;
    }
  }
  cout<<sum<<endl;
}
    

Measured memory_bytes: 1024
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        int N = in.nextInt();
        int T = in.nextInt();
        int[] A = new int[N];
        int[] B = new int[N];
        for (int i=0;i<N;i++) {
            A[i] = in.nextInt();
            B[i] = in.nextInt();
        }
        long[][] dp = new long[N+1][T+1];
        int[][] prev_w = new int[N+1][T+1];
        for (int i=1;i<=N;i++) {
            for (int j=1;j<=T-1;j++) {
                if (j-A[i-1]>=0) {
                    dp[i][j]=Math.max(dp[i-1][j],dp[i-1][j-A[i-1]]+B[i-1]);
                    if (dp[i-1][j-A[i-1]]+B[i-1]>dp[i-1][j]) {
                        prev_w[i][j] = j-A[i-1];
                    } else {
                        prev_w[i][j] = j;
                    }
                } else {
                    dp[i][j]=dp[i-1][j];
                    prev_w[i][j] = j;
                }
            }
        }
    int cur_w = T-1;
    int[] visited = new int[N];
    for (int i = N-1; i >= 0; --i) {
        if (prev_w[i+1][cur_w] == cur_w - A[i]) {
            // out.println(i+" th item (weight = "+A[i]+", value = "+B[i]+")");
            visited[i]=1;
        }
        cur_w = prev_w[i+1][cur_w];
    }

    int max = 0;
    for (int i=0;i<N;i++) {
        if (visited[i]==0) {
            max=Math.max(max, B[i]);
        }
    }
    out.println(dp[N][T-1]+max);
    // out.println(Arrays.toString(visited));
        // out.println(N);

        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}


Measured memory_bytes: 164408
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long w,h,x,y;
	cin>>w>>h>>x>>y;
	long long n=w;
	n*=h;
	n/=2;
	cout<<n;
	if(w%2&&h%2)
	{
		cout<<".5";
	}
	cout<<" ";
	int ans=0;
	if(w%2==0&&w/2==x)
	ans++;
	if(h%2==0&&h/2==y)
	ans++;
	if(h==w&&x==y)
	ans++;
	if(ans>1)
	cout<<1;
	else
	cout<<0;
	return 0;
}

Measured memory_bytes: 256
import math

# 与えられた数値の桁数と桁値の総和を計算する.
def calc_digit_sum(num):
    digits = sums = 0
    while num > 0:
        digits += 1
        sums += num % 10
        num //= 10
    return digits, sums


n = input()
answer = len(n)

num = int(n)
limit = int(math.sqrt(num)) + 1
for divide in range(1, limit):
    candidate = num // divide
    if candidate * divide == num:
        digit1 = len(str(divide))
        digit2 = len(str(candidate))
        answer = min(answer, max(digit1, digit2))

print(answer)



Measured memory_bytes: 65044