akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll n, m;
    cin >> n >> m;

    vl dp(n+2, -1);  // dp[i] : i段目からスタートしてn段目に上る移動方法の数
    rep(i, m) {
        ll a;
        cin >> a;
        dp[a] = 0;
    }

    dp[n+1] = 0;
    dp[n] = 1;
    for(ll i = n-1; i >= 0; i--) {
        if(dp[i] == -1) {
            dp[i] = dp[i+1] + dp[i+2];
            dp[i] %= mod;
        }
    }

    out(dp[0]);
    re0;
}

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

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            Console.WriteLine("{0}{1}{2}",input[0][0],input[1][0],input[2][0]);
        }
    }
}


Measured memory_bytes: 2776
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		string s=sc.S;
		int a=0;
		for(int i = 0;i<s.Length;i++) {
			if(s[i]=='o'){a++;}
		}
		Console.WriteLine("{0}",(a+(15-s.Length)>=8)?"YES":"NO");
	}
}

public class Sc{
	private string[] a;
	private int n=-1,m=0;
	public int I{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return int.Parse(a[n]);}}
	public long L{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return long.Parse(a[n]);}}
	public double D{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return double.Parse(a[n]);}}
	public string S{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return a[n];}}
	public string Sz{get{return Console.ReadLine();}}
	public int[] Ia{get{if(n!=-1&&n!=a.Length-1){m=n;n=-1;return Array.ConvertAll(a.Skip(m+1).ToArray(),int.Parse);}return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public int[] Ia2(int b){return Array.ConvertAll((((b&1)!=0?"0 ":"")+Console.ReadLine()+((b&2)!=0?" 0":"")).Split(),int.Parse);}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public string[] Sa2{get{return (Console.ReadLine()+" 0").Split();}}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 13140
import java.io.*;
import java.util.*;

public class Main implements Runnable {
    static ContestScanner in;
    static Writer out;
    public static void main(String[] args) {
        new Thread(null, new Main(), "", 16 * 1024 * 1024).start();
    }

    public void run() {
        Main main = new Main();
        try {
            in = new ContestScanner();
            out = new Writer();
            main.solve();
            out.close();
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    void solve() throws IOException {
        int n = in.nextInt();
        long[] a = new long[n + 1];
        long[] b = new long[n];
        for (int i = 0; i < n + 1; i++) {
            a[i] = in.nextLong();
        }
        long ans = 0;
        for (int i = 0; i < n; i++) {
            b[i] = in.nextLong();
            long beat = Math.min(a[i], b[i]);
            b[i] -= beat;
            ans += beat;
            beat = Math.min(a[i + 1], b[i]);
            a[i + 1] -= beat;
            ans += beat;
        }
        System.out.println(ans);
    }
}

class Writer extends PrintWriter{
    public Writer(String filename)throws IOException
    {super(new BufferedWriter(new FileWriter(filename)));}
    public Writer()throws IOException {super(System.out);}
}
class ContestScanner implements Closeable {
    private BufferedReader in;private int c=-2;
    public ContestScanner()throws IOException
    {in=new BufferedReader(new InputStreamReader(System.in));}
    public ContestScanner(String filename)throws IOException
    {in=new BufferedReader(new InputStreamReader(new FileInputStream(filename)));}
    public String nextToken()throws IOException {
        StringBuilder sb=new StringBuilder();
        while((c=in.read())!=-1&&Character.isWhitespace(c));
        while(c!=-1&&!Character.isWhitespace(c)){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public String readLine()throws IOException{
        StringBuilder sb=new StringBuilder();if(c==-2)c=in.read();
        while(c!=-1&&c!='\n'&&c!='\r'){sb.append((char)c);c=in.read();}
        return sb.toString();
    }
    public long nextLong()throws IOException,NumberFormatException
    {return Long.parseLong(nextToken());}
    public int nextInt()throws NumberFormatException,IOException
    {return(int)nextLong();}
    public double nextDouble()throws NumberFormatException,IOException
    {return Double.parseDouble(nextToken());}
    public void close() throws IOException {in.close();}
}


Measured memory_bytes: 44160
S = input().replace('BC', 'X')
N = len(S)

ans = 0
tmp = 0
for i in range(N-1, -1, -1):
    if S[i] == 'A':
        ans += tmp
    elif S[i] == 'X':
        tmp += 1
    else:
        tmp = 0
print(ans)

Measured memory_bytes: 3500
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    #r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]
    t = [int(stdin.readline()) for i in range(4)]

    #res = 0
    #a, b, c = map(int, r.split())
    print(min(t[0],t[1])+min(t[2],t[3]))

if __name__ == '__main__':
    main()



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

using namespace std;

int main() {
    int n, i;
    cin >> n;
    long long a[n];
    for(i = 0; i < n; i++) {
        cin >> a[i];
        if(a[i] == 0) {
            cout << "0" << endl;
            return 0;
        }
    }
    long long ans = 1;
    for(i = 0; i < n; i++) {
        if(a[i] <= 1000000000000000000/ans) { //10^18は大きすぎるためこの工夫が必須
            ans *= a[i];
        } else {
            cout << "-1" << endl;
            return 0;
        }
    }
    cout << ans << endl;
    return 0;
}

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

  int main(){

int n;
cin>>n;

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


int mn = a[0], mx = a[0];
long long sum = 0;
for(int i=0;i<n;i++){
  mn = min(mn, a[i]);
mx = max(mx, a[i]);
sum += a[i];
}


cout<<mn<<" "<<mx<<" "<<sum<<endl;

return 0;
}


Measured memory_bytes: 3136
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <limits>
#include <numeric>
#include <valarray>
#include <fstream>

using namespace std;
typedef unsigned int uint;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<LL, LL> PP;
#define REP(i,a,n) for(LL i = (a); i < (LL)(n); ++i)
#define REM(i,a,n) for(LL i = ((n) - 1); i >= (a); --i)
#define FLOAT fixed << setprecision(16)
#define SPEEDUP {cin.tie(0); ios::sync_with_stdio(false);}
const int INF = 0x3FFFFFFF;
const LL INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const string INFSTR = "\x7f";
const double EPS = 1.0e-9;

void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
template <class T, class U>
istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U>
ostream& operator<<(ostream& ost, const pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N>
void Fill(T(&dest)[N], const TCompatible& val) { fill(dest, dest + N, val); }
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
template<class T>
T Compare(T left, T right) { return left > right ? 1 : (left < right ? -1 : 0); }
istream& Ignore(istream& ist) { string s; ist >> s; return ist; }
bool Inside(int i, int j, int h, int w) { return i >= 0 && i < h && j >= 0 && j < w; }
// all_of
// partial_sum, adjacent_difference

#ifdef ONLY_MY_ENVIR
#include "IntMod.h"
#include "Union_Find.h"
#include "Graph.h"
#include "Range.h"
#include "Global.h"
#include "Flow_Solver.h"
#include "Tree.h"
#include "Suffix_Array.h"
#include "Geometry.h"
#include "Matrix.h"
#endif

#ifdef __GNUC__
typedef __int128 LLL;
istream& operator>> (istream& ist, __int128& val) { LL tmp;  ist >> tmp; val = tmp; return ist; }
ostream& operator<< (ostream& ost, __int128 val) { LL tmp = val; ost << tmp; return ost; }
#endif

#if 1234567891
#include <array>
#include <random>
#include <unordered_set>
#include <unordered_map>
template<typename T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >;	// コスト小を優先
#endif
string s;
int main() {
	cin >> s;
	s[3] = '8';
	cout << s << endl;
	return 0;
}


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

h = list(map(int,input().split()))

res = 0

while True:
    if max(h) == 0:
        break
    i = 0
    while i < N:
        if h[i] == 0:
            i += 1
        else:
            res += 1
            while i < N and h[i] > 0:
                h[i] -= 1
                i += 1
print(res)

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
vector <int> n;

int main(){
	int n,k,t,d,num=0;
	map <int,int> p;
	cin>>n>>k;
	for(int i=0;i<k;i++){
		cin>>d;
		for(int j=0;j<d;j++){
			cin>>t;
			if(p[t]==0){
				p[t]=1;
				num++;
			}
		}
	}
	cout<<n-num<<endl;
	return 0;
}


Measured memory_bytes: 3596
object Main extends App {
  case class Problem(n: Int, ratio: Long, bonus: Long) {
    val completeScore = n * ratio + bonus
  }
  case class Result(score: Long, count: Int)

  val in = new java.util.Scanner(System.in)
  val D = in.nextInt
  val G = in.nextLong / 100

  val Ps = Array.tabulate(D){i => Problem(in.nextInt, i + 1, in.nextLong / 100)}
  val comps: IndexedSeq[Result] = (0 until (1 << D)).map {mask =>
    (0 to D).foldLeft(Result(0L, 0)) {case (r, i) =>
      if (((1 << i) & mask) == 0) r else Result(r.score + Ps(i).completeScore, r.count + Ps(i).n)
    }
  }

  def getAll(i: Int): Seq[Int] = {
    val targetComps: Seq[Result] = (0 until (1 << D)).flatMap {mask =>
      if (((1 << i) & mask) != 0) None else Some(comps(mask))
    }

    val p = Ps(i)
    val halfways: Seq[Result] = (0 to p.n).map {n =>
      if (n == p.n) Result(p.completeScore, n) else Result(n * p.ratio, n)
    }

    for {
      c <- targetComps
      h <- halfways
      if (c.score + h.score >= G)
    } yield c.count + h.count
  }

  println((0 until D).flatMap(getAll).min)
}

Measured memory_bytes: 50792
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll a,b,c,x,i,j,k,hs;
int main()
{
//	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>a>>b>>c>>x;
	x/=50;
	for(i=0;i<=a;i++)
		for(j=0;j<=b;j++)
			for(k=0;k<=c;k++)
			{
				if(i*10+2*j+k==x)
					hs++;
			}
	cout<<hs<<"\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int, int> P;
typedef long long ll;

int main(){
    int n, x, y; cin >> n >> x >> y; x--; y--;

    Graph dist(n,vector<int> (n,1002003004));
    vector<int> ans(n-1,0);

    for(int i=0; i<=n-2; i++){
        for(int j = i+1; j<=n-1; j++){
            dist[i][j] = j-i;
        }
    }

    for(int i=0; i<=n-2; i++){
        for(int j=i+1; j<=n-1; j++){
            dist[i][j] = min(dist[i][j], abs(x-i)+abs(y-j)+1);
            dist[i][j]--;
            ans[dist[i][j]]++;
        }
    }

    rep(i,n-1) cout << ans[i] << endl;
}




Measured memory_bytes: 16000
import sys
import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    H, W = map(int, input().split())
    S = [[] for _ in range(H)]
    count = [[0] * W for _ in range(H)]

    # read and horizontal
    for i in range(H):
        s = list(input())
        S[i] = s
        con = 0
        for j in range(W):
            if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

    pass
    # vertical
    for j in range(W):
        ##############
        con = 0
        for i in range(H):
            if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

    m = 0
    for i in range(H):
        m =max(m,max(count[i]))
    print(m-1)

if __name__ == "__main__":
    main()


Measured memory_bytes: 264396
#include<iostream>
#include<sstream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cfloat>
#include<functional>
#include<map>
#include<string>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<bitset>
#include<list>
#include<numeric>
#include<complex>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<long long, long long> ll_ll;
typedef pair<double, double> d_d;
typedef vector<int> Vint;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define rep2d(i, j, n) for(i = 0;i < n;++i)for(j = i + 1;j < n;++j)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << x << "\n"
#define pri2(x, y) cout << x << " " << y << "\n"
#define pri3(x, y, z) cout << x << " " << y << " " << z << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << x << "\n"
#define debug2(x, y) cout << " --- " << x << " " << y << "\n"
#define debug3(x, y, z) cout << " --- " << x << " " << y << " " << z << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j, k;
  for(int testcase = 0;testcase >= 0;testcase++){
    int2(n, m);
    int a[n]; scn(n, a);

    for(k = 2;k <= m;++k){
      rep1(i, n)if(a[i - 1] % k > a[i] % k)swap(a[i - 1], a[i]);
    }
    rep(i, n)pri(a[i]);

/*/

//*/ break;
  }
  return 0;
}

Measured memory_bytes: 1240
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<functional>
#include<map>
using namespace std;
typedef long long ll;
int main()
{
	int t=0,f=0,o=0,T,F,O,ans;
	int n,y,res=0,yes=0;
	cin>>n>>y;
	y/=1000;
	t=y/10;y%=10;
	f=y/5;o=ans=y%5;//cout<<t<<" "<<f<<" "<<o<<endl;
	if(n<t+f+o)cout<<"-1 -1 -1"<<endl;
	else
	{
		for(int i=t;i>=0;i--)
		{	
			ans=o;
			for(int j=f;j>=0;j--)
			{
				res=i+j+ans;//cout<<i<<" "<<j<<" "<<ans<<endl;
				if(res==n)
					{yes=1;T=i;F=j;O=ans;
					break;}
				ans+=5;
			}
			if(yes)break;
			f+=2;
		}
		if(yes)cout<<T<<" "<<F<<" "<<O<<endl;
		else cout<<"-1 -1 -1"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	
	public static void main(String[] args) {

		// argumentの取得
		Scanner s = new Scanner(System.in);

		int A = s.nextInt();
        int B = s.nextInt();
      
        if (A < B) {
          int tmp = A;
          A = B;
          B = tmp;
        }
      
        if (B == 1) {
          System.out.println(A);
          return;
        }
      
        // なぜ long X = A * B; だとだめなのだ。。
        long X = A;
        X = X * B;
      
        //System.out.println("A = " + A); //debug
        //System.out.println("B = " + B); //debug
        //System.out.println("X = " + X); //debug
      
        int R = A % B; // 割った余りが入る	
        //System.out.println("R = " + R); //debug
      
        if (R == 0) {
          System.out.println(A);
          return;
        }
      
        // 無限Loop
      while(true){
          A = B;
          //System.out.println("A = " + A); //debug
          B = R;
          //System.out.println("B = " + B); //debug
          R = A % B;  // 再度割った余りが入る
          
          //System.out.println("R = " + R); //debug
        
          if(R == 0){
            break;
          }
      }
      
      System.out.println(X/B);
	} 
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
#define Elhabashy ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
void input()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
}
const int N=2e5+5,mod=1e9+7;
typedef long long ll;
int n,arr[N];
ll ans;
int main()
{
    Elhabashy
    input();
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>arr[i];
    sort(arr+1,arr+n+1);
    ans=arr[n];
    int cnt=0;
    int idx=n-1;
    for(int i=n-2;i>=1;i--){
        cnt++;
        ans+=arr[idx];
        if(cnt==2){
            cnt=0;
            idx--;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 4416
#include <stdio.h>
#include <ctype.h>
int main(){
    char a[10],b[10],c[10];
    scanf("%s %s %s",&a,&b,&c);
    int d=toupper(a[0]);
    int e=toupper(b[0]);
    int f=toupper(c[0]);
    printf("%c%c%c",d,e,f);
    return 0;
}

Measured memory_bytes: 128
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    N, M = MI()
    H = LI()
    H.insert(0,0)
    A = [0]*M
    B = [0]*M
    ans = 0
    for i in range(M):
        A[i], B[i]=MI()

    Hnum = [0]*(N+1)
    Hnum[0] = 1

    for i in range(M):
        if H[A[i]]>H[B[i]]:
            Hnum[B[i]]+=1
        elif H[A[i]]<H[B[i]]:
            Hnum[A[i]]+=1
        elif H[A[i]]==H[B[i]]:
            Hnum[A[i]]+=1
            Hnum[B[i]]+=1
    print(Hnum.count(0))


    """
    for i in range(1,N+1):
        ng = 0
        for j in range(M):
            if A[j] == i:
                if H[i]<=H[B[j]]:
                    ng += 1
                    break
            if B[j] == i:
                if H[i]<=H[A[j]]:
                    ng += 1
                    break
        if ng == 0:
            ans += 1
    print(ans)"""


    


if __name__ == "__main__":
	main()

Measured memory_bytes: 85576
#!python3

from time import perf_counter
tick = perf_counter() + 1.92

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
from random import randrange
from bisect import bisect

def resolve():
    it = map(int, sys.stdin.read().split())
    D = next(it)
    C = [next(it) for i in range(26)]
    S = [[next(it) for i in range(26)] for i in range(D)]
    L = [[-1] for i in range(26)]
    T = [0] * D

    def update(di, qi):
        T1, L1 = T[:], L[:]

        score = 0
        t0 = T[di]
        score += S[di][qi]-S[di][t0]
        T1[di] = qi

        L1[t0] = li = L[t0][:]
        ii = li.index(di)
        la = D if len(li)-1 == ii else li[ii+1]
        score -= C[t0] * (di-li[ii-1])*(la-di)
        li.pop(ii)

        L1[qi] = li = L[qi][:]
        ii = bisect(li, di)
        li.insert(ii, di)
        la = D if len(li)-1 == ii else li[ii+1]
        score += C[qi] * (di-li[ii-1])*(la-di)

        return score, T1, L1

    score = 0
    x = (1+D)*D//2
    for i in range(D):
        score += S[i][0]
        L[0].append(i)

    for i in range(1, 26):
        score -= C[i] * x

    i = 0
    tick0 = tick - 1
    while perf_counter() < tick0:
        diff, T1, L1 = update(i % D,  randrange(0, 26))
        if diff > 0:
            score += diff
            T, L = T1, L1
        i += 1

    while perf_counter() < tick:
        diff, T1, L1 = update(randrange(0, D), randrange(0, 26))
        if diff > 0:
            score += diff
            T, L = T1, L1

    print(*(i+1 for i in T), sep="\n")

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 99616
def main():
    N = int(input())
    S = input()
    ans = 0
    for n in range(N + 1):
        c = 0
        u = []
        for s in S[:n]:
            if s in u:
                continue
            if S[n:].count(s) > 0:
                c += 1
            u.append(s)
        ans = max(ans, c)
    print(ans)


main()


Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#define N 100005
#define ll long long
using namespace std;
int n,a[N];
ll s1[N],s2[N],sum;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]),sum+=a[i];
	sum/=2;
	s1[1]=a[n];
	for(int i=2;i<=n;i++){
		s1[i]=s1[i-2]+a[i-1];
	}
	for(int i=n-1;i>0;i--){
		s2[i]=s2[i+2]+a[i];
	}
	for(int i=1;i<=n;i++){
		printf("%d ",(sum-s1[i-1]-s2[i+1])*2);
	}
	puts("");
	return 0;
}


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

int main(){
    long long n,k,res;
    cin >> n >> k;
    if(k%2==1){
        res=(n/k)*(n/k)*(n/k);
    }
    else{
        res=(n/k)*(n/k)*(n/k);
        res+=((n+k/2)/k)*((n+k/2)/k)*((n+k/2)/k);
    }
    cout << res << endl;
}

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

using namespace std;



int main(){
  vector<int> v(2000000,0);
  vector<int> v1;

  int n,num;
  cin >>n;

  for(int i=0;i<n;i++){
    cin >>num;

    v[num]=v[num]+1;
    
    
  }
  int cnt = 0;



  for(  vector<int>::iterator p=v.begin();p!=v.end();p++){
    if(*p!=0){
      for(int i=0;i<*p;i++){
	v1.push_back(cnt);
	}
    }
    

    cnt++;
}


  for(  vector<int>::iterator p=v1.begin();p!=v1.end();p++){
    if(p!=v1.end()-1){cout <<*p<<" ";
     
    }else{
      cout <<*p<<endl;
    }
  }


  
  return 0;
}



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

using namespace std;
typedef pair<int,int> pii;
typedef long long int ll;

#define INF 1 << 29
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)



vector<bool> gen_sosuu(vector<bool> sosuu){
  int size = sosuu.size();
  REP(i,size){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(size)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<size;j++){
      sosuu[i*j] =false;
    }
  }
  return sosuu;
}

vector<int> a(3);

int main(){
  REP(i,3) cin >> a[i];
  sort(a.begin(),a.end());
  if(a[2] == a[1] + a[0]) cout << "Yes" << endl;
  else cout << "No" <<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
int mpow(int base, int exp); 
void ipgraph(int m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

void solve(){
	int d,t,s;
    cin>>d>>t>>s;
    if(s*t>=d){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    

}

int main() {
	ios_base::sync_with_stdio(0);
	int i,t=1;
	//cin>>t;
	for(i=1;i<=t;i++){
		solve();
	}
	return 0;
}

int mpow(int base, int exp) {
	base %= mod;
	int result = 1;
	while (exp > 0) {
		if (exp & 1) result = ((ll)result * base) % mod;
		base = ((ll)base * base) % mod;
		exp >>= 1;
	}
	return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
		g[u-1].pb(v-1);
		g[v-1].pb(u-1);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}




Measured memory_bytes: 10668
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

ll H, W, D;
pll A[100010];
ll acc[100010];

signed main(){
    cin >> H >> W >> D;
    ll a;
    REP(i, H){
        REP(j, W){
            cin >> a;
            A[a] = pll(i, j);
        }
    }
    REP(i, D){
        ll x = i + 1;
        while(x + D <= H * W){
            acc[x + D] = acc[x] + abs(A[x + D].first - A[x].first) + abs(A[x + D].second - A[x].second);
            x += D;
        }
    }
    ll Q, L, R;
    cin >> Q;
    REP(i, Q){
        cin >> L >> R;
        PRINT(acc[R] - acc[L]);
    }
    return 0;
}

Measured memory_bytes: 5664
#include <cstdio>
#include <vector>

#define MAX_V 100005

using namespace std;

struct Edge {
  int dst, cost;
  Edge() {}
  Edge(int b, int c) : dst(b), cost(c) {}
};

vector<Edge> tree[MAX_V];
int ans[MAX_V];

void dfs(int cur_v, int par_v, int color) {
  ans[cur_v] = color;
  for (int i = 0; i < tree[cur_v].size(); i++) {
    Edge e = tree[cur_v][i];
    if ( e.dst == par_v ) { continue; }
    dfs(e.dst, cur_v, (color+e.cost)%2);
  }
}

int main() {
  int n;
  scanf("%d", &n);

  for (int i = 0; i < n-1; i++) {
    int u, v, w;
    scanf("%d %d %d", &u, &v, &w);
    u--; v--;
    tree[u].push_back( Edge(v, w) );
    tree[v].push_back( Edge(u, w) );
  }
  
  dfs(0, -1, 0);

  for (int i = 0; i < n; i++) {
    printf("%d\n", ans[i]);
  }

  return 0;
}

Measured memory_bytes: 9088
A=input().split()
if (A[0]==A[1] and A[0]!=A[2]):
    print("Yes")
elif (A[0]==A[2] and A[0]!=A[1]):
    print("Yes")
elif (A[1]==A[2] and A[0]!=A[2]):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define ub upper_bound
#define lb lower_bound
#define all(v) ((v).begin()),((v).end())
#define allr(v) ((v).rbegin()),((v).rend())
#define ff first
#define ss second
#define mp make_pair
#define pll pair<ll,ll> 
#define fo(i,n) for(ll i=0;i<n;i++)
#define foa(i,s,e) for(ll i=(s);i<e;i++)
#define fod(i,s,e) for(ll i= (s);i>=(e);i--)
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
#define sz(x) (ll)(x.size())
#define ANS cout<<ans<<'\n'
#define YES cout<<"YES\n"
#define NO cout<<"NO\n"
#define Yes cout<<"Yes\n"
#define No cout<<"No\n"
const ld pi = 3.14159265358979323846;
ll MOD = 1e9 + 7;
//ll MOD = 998244353;
const char nl = '\n';
const ll inf = 1e15;
ll mul(ll x,ll y){
    return (1ll* (x%MOD)*(y%MOD));
}
ll modpow(ll x,ll y){ll z=1;while(y>0){if(y%2)z=mul(z,x);x =mul(x,x) ;y/=2;}return z;}
ll power(ll x,ll y){ll z=1;while(y>0){if(y%2)z=z*x;x =x*x ;y/=2;}return z;}
ll gcd(ll a,ll b){if(a<b) return gcd(b,a);if(b==0) return a;return gcd(b,a%b);} 
ll min(ll a,ll b){if(a<b)return a;return b;}
ll max(ll a,ll b){if(a>b)return a;return b;}
ll sq(ll a){
    ll ans = (1ll*a*a);
    return ans; 
}
void solve()
{
    ll h,w;
    cin>>h>>w;
    string a[h];
    fo(i,h)
    {
        cin>>a[i];
    }
    ll ans[h][w];
    memset(ans,0,sizeof(ans));
    ll i,j;
    for(i=0;i<h;i++)
    {
        for(j=0;j<w;j++)
        {
            if(i==0)
            {
                if(j==0)
                {
                    ans[i][j]=1;
                }
                else
                {
                    if(a[i][j]==46)
                    {
                        ans[i][j]=ans[i][j-1];
                    }
                    else
                    {
                        ans[i][j]=0;
                    }
                }
            }
            else if(j==0)
            {   
                if(a[i][j]==46)
                {
                    ans[i][j]=ans[i-1][j];
                    ans[i][j]=ans[i][j]%MOD;
                }
                else
                {
                    ans[i][j]=0;
                }
            }
            else
            {   
                if(a[i][j]==46)
                {
                    ans[i][j]=ans[i-1][j]+ans[i][j-1];
                    ans[i][j]=ans[i][j]%MOD;
                }
                else
                {
                    a[i][j]=0;
                }
            }
        }
    }
    cout<<ans[h-1][w-1]%MOD<<nl;


}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    ll TC = 1;
    //cin>>TC;
    while(TC--){
        solve();
    }
}


Measured memory_bytes: 12488
import sys
import collections

#+++++

def count_max(a_len, using):
	if a_len < 3:
		return 0
	
	total = 3 ** a_len
	
	#33...33, 55...55,77...77
	all_single = 3 - len(using)
	
	#333553535
	tt = 2 ** a_len - 2
	
	



def main():
	n = int(input())
	#b , c = map(int, input().split())
	#s = input()
	ret = 0
	q = collections.deque()
	if n < 357:
		return 0
	
	for i, v in enumerate([3,5,7]):
		q.append((v, 1, 2**i))
		
	while q:
		value, keta, is_full = q.popleft()
		#print(value,keta,is_full)
		for i, v in enumerate([3,5,7]):
			n_value = value + v*(10**keta)
			if n_value > n:
				continue
			n_is_full = is_full | (2**i)
			if n_is_full == 7:
				ret += 1
			q.append((n_value, keta+1, n_is_full))
	
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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

int main(){
  int N;
  cin >> N;
  vector<vector<ll>> num(10, vector<ll>(10, 0));
  for(int i = 1; i <= N; i++){
    int n = i;
    vector<int> d;
    while(n){
      d.push_back(n % 10);
      n /= 10;
    }
    int a = d[0];
    int b = d.back();
    if(a == 0||b == 0){
      continue;
    }
    num[a][b]++;
  }
  ll ans = 0;
  for(int a = 1; a < 10; a++){
    for(int b = 1; b < 10; b++){
      ans += num[a][b] * num[b][a];
    }
  }
  cout << ans << endl;
}


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

char s[200001], t[200001];

int main()
{
    int cnt=0;
    cin >> s;
    cin>> t;

    int len = strlen(s);

    for(int i = 0; i < len; i++)
    {
        if(s[i] != t[i]) cnt++;
    }

    cout << cnt;
}


Measured memory_bytes: 3540
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i=(n); i>=0; --i)
#define FOR(i, n, m) for(int i=(m), i##_len=(n); i<i##_len; ++i)
#define EACH(i, v) for(const auto& i : v)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
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; }
template<class Value>using vec = vector< Value >;
using ll = long long;
using P = pair< long long, long long >;
#define fi first
#define se second
#define el endl
#pragma endregion

void Main();

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

void Main(){
    int N, L;
    cin >> N >> L;
    vec<string> ss(N);
    REP(i, N){
        cin >> ss[i];
    }
    sort(ALL(ss));
    REP(i, N){
        cout << ss[i];
    }
    cout << el;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;

static int le[10];

void rec(int i, int N, int ma = -1) {
    if (i == N) {
        for (int j = 0; j < N; ++j)
            cout << (char)('a' + le[j]);
        cout << '\n';
        return;
    }
    for (int j = 0; j <= ma + 1; ++j) {
        le[i] = j;
        rec(i + 1, N, max(ma, j));
    }
}

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

    int N;
    cin >> N;

    rec(0, N);

    return 0;
}


Measured memory_bytes: 1536
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <set>
#include <numeric>

#include <map>
#include <math.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <bitset>
#include <math.h>

#define INF 100100100

typedef long long int llint;

using namespace std;

typedef pair<int, int>Pii;

#define pi 3.141592653589793

int main() {
	llint a, b, x;
	cin >> a >> b >> x;
	if (a % x== 0)cout << b / x - a / x + 1; 
	else cout << b / x - a / x;
	cout << endl;
	return 0;
}

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


using namespace std;
int main(){

   string n;
  //  int a;
  //  char b;
    getline(cin,n);
  //  a = n.GetLength();
   reverse(n.begin(),n.end());
  //  for(int i=0;i<a/2;i++){
  //    b = n[i];
  //    n[i] = n[a-i-1];
  //    n[a-i-1] = b;
  //  }

  cout << n << endl;
 
 return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}

typedef pair<ll, ll> P;
vec d;
struct edge {
    ll to, cost;
};
vector<vector<edge>> G;

void dijkstra (ll s, ll V) {
    priority_queue<P, vector<P>, greater<P>> que;
    d.assign(V, inf);
    d[s] = 0;
    que.push(P(0, s));

    while (!que.empty()) {
        P p = que.top(); que.pop();
        ll v = p.second;
        if (d[v] < p.first) continue;
        for (edge e : G[v]) {
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }
}

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

    ll N, M, S;
    cin >> N >> M >> S;

    G.assign(N*2600, vector<edge>());
    while (M--) {
        ll U, V, A, B;
        cin >> U >> V >> A >> B;
        U--; V--;
        Rep (i, 2500) {
            if (i-A >= 0) {
                G[2600*U+i].push_back({2600*V+i-A, B});
                G[2600*V+i].push_back({2600*U+i-A, B});
            }
        }
    }

    Rep (i, N) {
        ll C, D;
        cin >> C >> D;
        Rep (j, 2500) {
            if (j+C <= 2500) {
                G[2600*i+j].push_back({2600*i+j+C, D});
            }
        }
    }

    chmin(S, (ll)2499);
    dijkstra(S, N*2600);

    // Rep (i, N) {
    //     Rep (j, 5) {
    //         cout << d[i*2600+j] << " \n"[j==4];
    //     }
    // }

    for (ll i = 1; i < N; i++) {
        ll ans = inf;
        Rep (j, 2600) {
            chmin(ans, d[i*2600+j]);
        }
        cout << ans << "\n";
    }
}

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

int main(){
    string s;
    cin >> s;

    if ( s.front() == 'A' ){
        int cnt = 0;
        for ( int i = 2; i <= s.length()-2; ++i ){
            cnt += (s[i] == 'C');
        }
        if ( cnt == 1 ){
            cnt = 0;
            for ( int i = 0; i < s.length(); ++i ){
                cnt += (s[i] >= 'a' && s[i] <= 'z');
            }
            if ( cnt + 2 == s.length() ){
                return cout << "AC" , 0;
            }
        }
    }
    cout << "WA";
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<utility>
#include<array>
#include<cassert>
#include<list>
#include<experimental/any>
#include<cstring>
#include<cctype>
#include<ctime>
#include<cstdbool>
#include<cstdint>
#include<cstddef>
#include<set>
#include<unordered_set>
#include<bitset>
 
using namespace std;
using experimental::any;
 
#define SPEEDY cin.tie(0);ios::sync_with_stdio(false);
 
#define REP(i,n) for(int i=0;i<(n);i++)
#define ARREP(i,n,X) for(int i=0;i<(n);i++)cin>>X[i]
#define FOR(i,X,n) for(int i=(X);i<(n);i++)
#define EREP(i,n) for(int i=1;i<=n;i++)
#define BitFOR(N) REP(Bit,1<<(N))
 
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define DEB2(X) cout<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define TFDEB(f) (f)? cout<<"true ":cout<<"false ";
#define FORDEB(n,X) for(int i=0;i<(n);i++)ARDEB(i,X)
#define END cout<<endl;
#else
#define DEB(X) {}
#define DEB2(X) {}
#define ARDEB(i,X) {}
#define TFDEB(f) {}
#define FORDEB(n,X) {}
#define END {}
#endif
 
typedef long long int ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
#define ALL(X) X.begin(),X.end()
struct edge{int to,cost;};
//struct edge{int from,cost,to;};
struct P2{int x,y;};
#define BIT(Bit,n) bitset<n>(Bit)
#define Endl endl
 
const int MOD7=1000000007;
const int INF=100000000;
const int SET=1000;
 

 
int main(){
	int n,t[100010],x[100010],y[100010],ed;
	bool f=false;
	int count=0;
	cin>>n;
	REP(i,n){
		cin>>t[i]>>x[i]>>y[i];
	}
	REP(i,n){//x[i]+y[i]
		if(i==0){
			if(t[i]==x[i]+y[i]){
				count++;
			}
			else if((t[i]-(x[i]+y[i]))%2==0&&(t[i]-(x[i]+y[i])>=0)){
				count++;
			}
		}
		else{
			int dimt=t[i]-t[i-1];
			int dimx=x[i]-x[i-1];
			int dimy=y[i]-y[i-1];
			if(dimt==dimx+dimy){
				count++;
			}
			else if((dimt-(dimx+dimy))%2==0&&(dimt-(dimx+dimy)>=0)){
				count++;
			}
		}
	}
	if(count==n){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 1408
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		int sum = 0;
		for (int i = a; 0 < i; i--) {
			String s = String.valueOf(i);
			int temp = 0;
			for (int j = 0; j < s.length(); j++) {
				temp += Integer.parseInt(s.substring(j, j + 1));
			}
			if (temp >= b && temp <= c) {
				sum += i;
			}
		}
		
        System.out.println(sum);
	}
}

Measured memory_bytes: 25428
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define var auto
#define mod 1000000007
#define inf 2147483647
#define nil -1
typedef long long ll;

using namespace std;

inline int input(){
    int a;
    cin >> a;
    return a;
}

template <typename T>
inline void output(T a, int p) {
    if(p){
        cout << fixed << setprecision(p)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

// end of template

// union find
class union_find {
public:
    vector<int> parent, rnk;
    
    union_find(int n){
        parent.resize(n);
        rnk.resize(n, 0);
        rep(i, n){
            parent[i] = i;
        }
    }
    
    int root(int x){
        if (parent[x] == x) {
            return x;
        }
        else{
            return root(parent[x]);
        }
    }
    
    void unite(int x, int y){
        x = root(x);
        y = root(y);
        if (x == y) {
            return;
        }
        if (rnk[x] < rnk[y]) {
            parent[x] = y;
        }
        else{
            parent[y] = x;
            if (rnk[x] == rnk[y]) {
                rnk[x]++;
            }
        }
    }
    
    bool same(int x, int y){
        return root(x) == root(y);
    }
};



int main() {
    cin.tie(0);
    // source code
    int N, Q;
    cin >> N >> Q;
    union_find uf(N);
    
    rep(i, Q){
        int com, x, y; // com 0: unite 1: same
        cin >> com >> x >> y;
        if (com) {
            cout << (uf.same(x, y) ? 1 : 0) << endl;
        }
        else{
            uf.unite(x, y);
            
        }
    }
    
    
    return 0;
}

Measured memory_bytes: 3172
//include
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

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

//change
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}

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

template <class T>
inline T nCr(T n, T r)
{
    T num = 1;
    for (int i = 1; i <= r; ++i)
    {
        num *= (n - i + 1) / i;
    }
    return num;
}
template <class T>
inline T nPr(T n, T r)
{
    r = n - r;
    T sum = 1;
    int i;
    for (i = n; i >= r + 1; --i)
        sum *= i;
    return sum;
}

template <class T>
inline T facctorial(T k)
{
    T sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

//numeric
template <class T>
inline T gcd(T a, T b)
{
    if (a < b)
    {
        a ^= b;
        b ^= a;
        a ^= b;
    }

    return b ? gcd(b, a % b) : a;
}

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

//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())

//repetition
#define FOR(i, a, b) for (int i = (a); i <= (int)(b); ++i)
#define REP(i, n) FOR(i, 0, n)

//constant
constexpr double EPS = 1e-10;
const double PI = acos(-1.0);
constexpr LL INF = 1e10;

//clear memory
#define CLR(a) memset((a), 0, sizeof(a))

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

int main()
{
    int n;
    cin >> n;
    vector<int> h(n);
    int cnt = 0, ans = 0;
    for (int i = 0; i < n; ++i)
    {
        cin >> h[i];
    }
    for (int i = 0; i < n - 1; ++i)
    {
        if (h[i] >= h[i + 1])
        {
            ++cnt;
        }
        else
        {
            ans = max(cnt, ans);
            cnt = 0;
        }
    }
    ans = max(cnt, ans);
    cnt = 0;
    cout << ans << endl;
}


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

#define rep(i, a) for (int i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define vi vector<int>

#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cerr << #x1 << ": " << x1 << endl
#define debug_2(x1, x2) cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define debug_3(x1, x2, x3) cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << endl
#define debug_4(x1, x2, x3, x4) cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << endl
#define debug_5(x1, x2, x3, x4, x5) cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#define debug(...) CHOOSE((__VA_ARGS__, debug_5, debug_4, debug_3, debug_2, debug_1, ~)) (__VA_ARGS__)

using namespace std;
using ll = long long;
using P = pair<int, int>;

void Main() {
  ll n, k;
  cin >> n >> k;
  ll ans = (n/k)*(n/k)*(n/k);
  if (k%2==0) {
    ll count = 0;
    REP(i, 1, n+1) if (i%k == k/2) count++;
    ans += count*count*count;
  }
  cout << ans << endl;
}

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


Measured memory_bytes: 256