akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include<cmath>
#include<cstring>
#define pb push_back
#define pi acos(-1.0)
#define loop(i,a,n) for(int i=a;i<n;i++)
#define rloop(i,a,n) for(int i=n;i>=a;i--)
#define ff first
#define ss second
#define sc1(a) scanf("%d",&a)
#define sc2(a,b) scanf("%d %d",&a,&b)
#define sc3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/(gcd(a,b))
#define ms(a,b) memset(a,b,sizeof a)
#define check cout<<"HI"<<endl;

using namespace std;


#define i64 unsigned long long

long long int dp[9999][9999];

void nCr()
{
    //dp[0][0]=1;
    loop(i,1,2011)
    {
        loop(j,1,i+1)
        {
            dp[i][0]=1;
            if(i==j)dp[i][j]=1;
            else
            {
                dp[i][j]=(dp[i-1][j-1]%1000000007 + dp[i-1][j]%1000000007)%1000000007;
            }
        }
    }
}

int main()
{
    nCr();
    int n ,k,m ;
    sc2(n,k);
    m=n-k+1;
    cout<<m<<endl;
    loop(i,2,k+1){
        long long int ans = (dp[m][i]%1000000007*dp[k-1][i-1]%1000000007)%1000000007;
    //long long int ans = (nCr(m, i)%1000000009*nCr((k-1),(i-1))%1000000007)%1000000009;
    printf("%lld\n",ans);
    }//cout <<nCrModp(m, k, 1000000007)<<endl;

    return 0;
}
;









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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t,flag=0;
    cin>>t;
	while(t!=0)
	{
		
	int x= t%10;
	if(x==7)
	{
		flag=1;
		break;
	}
	
		t/=10;
	}
    
    if(flag==1)
    	cout<<"Yes";
    else
    	cout<<"No";
    
    
    return 0;
}

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

int N;
vector<vector<pair<int,int>>> v;

bool check(int bit){
    for(int i=0; i<N; i++){
        if(!(bit & (1<<i)) ) continue;

        for(pair<int,int> in : v[i]){
            int x = in.first;
            int y = in.second;

            if(y == 1 && !(bit & (1 << x))) return false;
            if(y == 0 && (bit & (1 << x))) return false;
        }
    }

    return true;
}

int main(){
    cin>>N;
    v.resize(N);
    for(int i=0; i<N; i++){
        int A;
        cin>>A;
        v[i].resize(A);
        for(int j=0; j<A; j++){
            cin>>v[i][j].first>>v[i][j].second;
            --v[i][j].first;
        }
    }

    int ans = 0;

    for(int bit = 0; bit < (1<<N); bit++){
        int cnt = 0;
        if(check(bit)){
            for(int i=0; i<N; i++){
                if(bit & (1<<i)) cnt++;
            }
        }

        ans = max(cnt,ans);
    }

    cout<<ans<<endl;
}

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

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

int main(){
    int n;
    while(cin >> n, n){
        int count = 0;
        while(n != 1){
            if(n % 2 == 0) n /= 2;
            else n = n*3 + 1;
            count++;
        }
        cout << count << endl;
    }
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
  int s;
  cin>>s;
 
  if(s/100 <=12 && s/100>0){
    if(s%100 <=12 && s%100>0) cout<<"AMBIGUOUS"<<endl;
    else cout<<"MMYY"<<endl;
  }
  else if(s%100 <=12 && s%100>0) cout<<"YYMM"<<endl;
  else cout<<"NA"<<endl;

  return 0;
}








Measured memory_bytes: 256
<?php /*test.php*/

$t = new temp();

$t->stdin(fgets(STDIN));

unset($t);

class temp{
	private $stdin = array();
	
	public function __construct(){
	}

	public function stdin($data = null){
		$this->stdin = explode(" ", $data);
		$l = 0;
		$r = 0;
		$l += $this->stdin[0] +
			$this->stdin[1];
		$r += $this->stdin[2] +
			$this->stdin[3];
		if($l == $r){
			echo "Balanced";
		}elseif($l < $r){
			echo "Right";
		}else{
			echo "Left";
		}
	}
}

?>


Measured memory_bytes: 3828
package main

import "fmt"

func main() {
	var A, B, K int
	fmt.Scanf("%d %d %d", &A, &B, &K)
	if A >= K {
		A -= K
	} else if A+B >= K {
		K -= A
		A = 0
		B -= K
	} else {
		A = 0
		B = 0
	}
	fmt.Println(A, B)
}


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

int main(){
    int A, B, C, D;
    cin >> A >> B >> C >>D;
    while (1){
        if (C - B <= 0){
            cout << "Yes" <<endl;
            break;
        }
        else
            C = C - B;

        if (A - D <= 0){
            cout << "No" << endl;
            break;
        }
        else
            A = A - D;
    }
}


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

string S; int K;

int main() {
	cin >> S >> K;
	vector<string>vec;
	for (int i = 0; i < S.size(); i++) {
		for (int j = i; j < min((int)S.size(), i + 6); j++) vec.push_back(S.substr(i, j - i + 1));
	}
	sort(vec.begin(), vec.end());
	vec.erase(unique(vec.begin(), vec.end()), vec.end());
	cout << vec[K - 1] << endl;
	return 0;
}

Measured memory_bytes: 1916
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <map>
 
using namespace std;

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

    char b;
    cin >> b;

    if(b == 'A')
    {
        cout << "T";
        return 0;
    }

    else if(b == 'T')
    {
        cout << "A";
        return 0;
    }

    else if(b == 'G')
    {
        cout << "C";
        return 0;
    }

    else
    {
        cout << "G";
    }
    
}

Measured memory_bytes: 888
/// Swift5 -> Swift2.2

extension String {
    // split(separator:maxSplits:omittingEmptySubsequences:)
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map(String.init)
    }
}
extension Array {
    // init(repeating:count:)
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
    // lastIndex(where:)
    func lastIndex(where predicate: (Element) -> Bool) -> Int? {
      	for i in stride(from: count - 1, through: 0, by: -1) {
          	if predicate(self[i]) {
              	return i
            }
        }
      	return nil
    }
}
extension Array where Element: Comparable {
    // sorted()
    func sorted() -> [Element] {
        return self.sort( { $0 < $1 } )
    }
    // max()
    func max() -> Element? {
        guard self.count > 0 else { return nil }
        return self.reduce(self.first!) { return Swift.max($0, $1) }
    }
}
// stride(from:through:by:)
func stride(from start: Int, through end: Int, by stride: Int) -> StrideThrough<Int> {
    return start.stride(through: end, by: stride)
}
// stride(from:to:by)
func stride(from start: Int, to end: Int, by stride: Int) -> StrideTo<Int> {
    return start.stride(to: end, by: stride)
}

/// end

let input = readLine()!.split(separator: " ").map { Int($0)! }
let N = input[0]
let M = input[1]

var edges = Array(repeating: [Int](), count: N + 1)
var sortedNodes = [Int]()
var sourceNodes = [Int]()
var indegrees = Array(repeating: 0, count: N + 1)

for _ in stride(from: 0, to: M, by: 1) {
    let edge = readLine()!.split(separator: " ").map { Int($0)! }
    let sourceNode = edge[0]
    let destinationNode = edge[1]
    edges[sourceNode].append(destinationNode)
    indegrees[destinationNode] += 1
}

for i in stride(from: 1, through: N, by : 1) {
    if indegrees[i] == 0 {
        sourceNodes.append(i)
    }
}

while sourceNodes.count > 0 {
    let sourceNode = sourceNodes.popLast()!
    sortedNodes.append(sourceNode)

    for destinationNode in edges[sourceNode] {
        indegrees[destinationNode] -= 1
        if indegrees[destinationNode] == 0 {
            sourceNodes.append(destinationNode)
        }
    }
}

var dp = Array(repeating: 0, count: N + 1)

for sourceNode in sortedNodes {
    for destinationNode in edges[sourceNode] {
        dp[destinationNode] = max(dp[destinationNode], dp[sourceNode] + 1)
    }
}

print(dp.max()!)


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll h,w;
ll ans[50][50];
int dx[] = {0,1,0,-1,-1,1,1,-1};
int dy[] = {1,0,-1,0,1,-1,1,-1};

int main(){
    cin >> h >> w;
    vector<string> s(h);
    rep(i,h)cin >> s[i];
    rep(i,h){
        rep(j,w){
            if(s[i][j] == '.')continue;
            rep(k,8){
                int nx = j+dx[k];
                int ny = i+dy[k];
                if(ny >= 0 && ny < h && nx >= 0 && nx < w){
                    ans[ny][nx]++;
                }
            }
        }
    }
    rep(i,h){
        rep(j,w){
            if(s[i][j] == '.')cout << ans[i][j];
            else cout << s[i][j];
        }
        cout << endl;
    }
}

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

bool isPrime(int num){
  if (num < 2) return false;
  else if (num == 2) return true;
  else if (num %2 == 0)return false;
  for(int i=3; i<=sqrt(num); i+=2){
    if(num % i == 0){
      return false;
    }
  }
  return true;
}

int main() {
  int x;
  cin >> x;
  while(true){
    if(isPrime(x)){
      cout << x << endl;
      break;
    }else{
      x++;
    }
  }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vl vector<LL>
#define vii vector<vi>
#define vll vector<vl>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

void make(string s,int lm,int mx){
    int ln=s.length();
    if(ln==lm){
        cout<<s<<endl;
        return ;
    }else{
        FOR(i,0,mx+2){
            make(s+(char)('a'+i),lm,max(mx,i));
        }
    }

}

int main(){
	int n;
    cin>>n;
    make("a",n,0);

}


Measured memory_bytes: 1536
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Arrays;
import java.util.Scanner;
import java.util.ArrayList;

/**
 * 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);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        int N;
        int M;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            N = in.nextInt();
            M = in.nextInt();

            List<List<Integer>> list = new ArrayList<>();
            for (int i = 0; i <= N; i++) {
                list.add(new ArrayList<>());
            }
            for (int i = 0; i < M; i++) {
                int k = in.nextInt();
                for (int j = 0; j < k; j++) {
                    int s = in.nextInt();
                    list.get(s).add(i);
                }
            }
            int[] p = new int[M];
            for (int i = 0; i < M; i++) {
                p[i] = in.nextInt();
            }

            int[] dp = new int[1025];
            int im = (int) Math.pow(2, N);
            for (int i = 0; i < im; i++) {
                dp[i + 1] = check(i, list, p) + dp[i];
            }
            out.println(dp[im]);
        }

        private int check(int n, List<List<Integer>> list, int[] p) {
            int[] count = new int[M];
            Arrays.fill(count, 0);

            for (int i = 0; i < N; i++) {
                if ((n & (1 << i)) > 0) {
                    for (int s : list.get(i + 1)) {
                        count[s]++;
                    }
                }
            }

            boolean lamp = true;
            for (int i = 0; i < M && lamp; i++) {
                lamp = lamp && count[i] % 2 == p[i];
            }
            return lamp ? 1 : 0;
        }

    }
}



Measured memory_bytes: 22484
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//using ll = long long;
//void p(vector<int> A){rep(i,A.size()){cout << A[i] << " ";}cout << "\n";}

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n-1);
    rep(i,n-1) cin >> b[i];
    a[0] = b[0];
    for (int i = 1; i <= n-2; i++){
        a[i] = min(b[i],b[i-1]);
    }
    a[n-1] = b[n-2];
    int ans = 0;
    rep(i,n) ans += a[i];
    cout << ans;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using P = pair<double,ll>;
using um = unordered_map<ll,ll>;
#define fl cout<<flush;
#define endl '\n'
template <typename T> inline void prt(T v){cout<<v<<'\n';}
template <typename T> inline bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template <typename T> inline bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;}
const ll INF=1LL<<60;
const ll MOD=1e9+7;
const ll MOD2=998244353;
const ld pi=3.14159265358979323846;
const ld eps=1e-10;

signed main(void){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    ll D;
    cin >> D;
    vector<double> c(27,0);
    for(ll i=0;i<26;++i)cin>>c[i+1];
    vector<vector<double>> S(D+1, vector<double>(27, 0));
    for(ll i=0;i<D;++i)
        for(ll j=0;j<26;++j)cin>>S[i+1][j+1];
    ll Maxscore=-INF;
    vl ans;
    for(double k=1.0;k<=47;k+=0.02){
        vector<ll> last(27,0);
        ll score=0;
        vector<ll> t(D+1,0);
        for(ll i=1;i<=D;++i){
            set<P> hoge;
            for(ll j=1;j<=26;++j){
                hoge.insert(P(S[i][j]+c[j]*(max(k,(double)D-i)),j));
            }
            t[i]=(*--hoge.end()).second;
            last[t[i]]=i;
            score+=S[i][t[i]];
            for(ll j=1;j<=26;++j)score-=c[j]*(i-last[j]);
        }
        if(chmax(Maxscore,score))ans=t;
    }
    for(ll i=1;i<=D;++i)prt(ans[i]);

    return 0;
}



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

int main(){
	int n,x;
	cin >> n >> x;
	vector<int> a(n);
	rep(i,0,n){
		cin >> a[i];
	}

	sort(a.begin(),a.end());
	
	int now = 0;
	int count = 0;
	rep(i,0,n){
		now += a[i];
		if(now <= x)count++;
		else break;
		if((n-1 == i) && (now != x))count--; 
	}
	cout << count << endl;
}

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

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }

typedef pair<int, int> P;

ll dp[55][55][3005];

int main() {
    ll n,a; cin >> n >> a;
    vector<ll> x(n);
    rep(i, n) cin >> x[i];

    // dp探索
    dp[0][0][0] = 1;
    rep(i, n) rep(j, n) rep(k, n*a) {
        // i番目のカードを選ばない場合
        dp[i+1][j][k] += dp[i][j][k];
        // i番目のカードを選ぶ場合
        dp[i+1][j+1][k+x[i]] += dp[i][j][k];
    }

    // 解を求める
    ll ans = 0;
    EFOR(i, 1, n) {
        ans += dp[n][i][i*a];
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 66560
main = do
  _ <- getLine
  s <- getContents
  let ss = map words . lines $ s
  let [taro,hana] = solve ss
  putStrLn $ (show taro) ++ " " ++ (show hana) 

solve :: [[String]] -> [Int]
solve s = let t = map (\[x,y] -> 
                        if x>y then [3,0]
                        else if x<y then [0,3]
                             else [1,1] ) s
          in foldl (\[sx,sy] [x,y] -> [sx+x,sy+y]) [0,0] t

Measured memory_bytes: 4380
#include "iostream"
#include "algorithm"
using namespace std;
int abs(int n) {
	return (n < 0) ? -n : n;
}
int main() {
	long long int n, cnt;
	int a[200000],b[200000];
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		a[i]-= i;
		b[i] = a[i];
	}
	sort(a, a + n);
	int i = a[n/2];
	cnt = 0;
		for (int j = 0; j < n; j++) {
			cnt += abs(b[j]-i);
		}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 1792
///*******
//
///HR_Bappy
//
///*******

#include<bits/stdc++.h>
#define pb push_back
#define mkp make_pair
#define maxx 1000000005
#define MOD 1000003
#define sf(n) scanf("%lld", &n);
#define sff(n,m) scanf("%lld %lld", &n, &m)
#define pf(n) printf("%lld\n", n)
#define pff(n,m) printf("%lld %lld\n", n, m)
#define mem(a) memset(a, 0, sizeof(a))
#define fr(i,n) for(ll i=0; i<n; i++)
#define my_sizeof(type) ((char *)(&type+1)-(char*)(&type))
#define pi 2*acos(0.0)
#define F first
#define S second
#define EPS 1e-9

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

void Cnttri(vector <int> v){

    int n=v.size();

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

    int c = 0;

    for( int i = n-1; i >= 1; i--){
        int l = 0, r = i-1;
        while( l < r){
            if( v[l] + v[r] > v[i]){


                c += r - l ;
                r--;
            }
            else

                l++;
        }
    }
    cout<<c << endl;;
}
int main(){

    int n;
    cin >>n;
    vector<int>v;
    for(int i = 0 ; i < n; i++){
        int a;
        cin >> a;
        v.pb(a);
    }

    Cnttri(v);

}


Measured memory_bytes: 256
N=int(input())
A=[]
for i in range(N):
    A.append(input())
a=0
w=0
t=0
r=0
for i in A:
    if i=='AC':
        a+=1
    elif i =='WA':
        w+=1
    elif i =='TLE':
        t+=1
    else:
        r+=1
print('AC x '+str(a))
print('WA x '+str(w))
print('TLE x '+str(t))
print('RE x '+str(r))

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

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	llong N;
	vector<llong> a;

	cin >> N;
	a.resize(N + 1);
	for(int i = 1; i <= N; i++)
		cin >> a[i];

	int ans = 0;
	int pos = 1;
	while(ans < N*2 && pos != 2){
		ans++;
		pos = a[pos];
	}

	if(ans == N*2)
		cout << -1 << endl;
	else
		cout << ans << endl;

	return 0;
}

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

int main()
{
    int a, b, c, i, sum=0, t=0;
    cin >> a >> b >> c;
    for(i=1;i<=20;i++)
    {
        t = t+a;
        if(t>c)
        {
            break;
        }
        sum = sum + (b*1);
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys

s = (input().split(' '))

n,m = [int(i) for i in s]

l_list = []
r_list = []

for i in range(m):
    s = (input().split(' '))
    l,r = [int(i) for i in s]
    l_list.append(l)
    r_list.append(r)

range = (max(l_list), min(r_list))

if range[0] > range[1]:
    print(0)
else:
    print(range[1] - range[0] + 1)

Measured memory_bytes: 10996
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
    int ans = 0;
    int tmp;
    
    int n, k, c;
    cin >> n >> k >> c;
    string s;
    cin >> s;
    s = "-" + s;
    tmp = 1;
    int l[k] = {}, r[k]={};
    REP(i, k){
        for(int j = tmp; j <= n; j++){
            if(s[j] == 'o'){
                l[i] = j;
                tmp = j + c + 1;
                //cout << j << " ";
                break;
            }
        }
    }
    //cout << endl;
    tmp = n;
    for(int i = k-1; i >= 0; i--){
        for(int j = tmp; j >= 1; j--){
            if(s[j] == 'o'){
                r[i] = j;
                tmp = j - c - 1;
                //cout << j << " ";
                break;
            }
        }
    }
    //cout << endl; 
    REP(i, k){
        if(r[i] == l[i]) cout << l[i] << endl;
    }
    //cout << ans << endl;
}

Measured memory_bytes: 3392
#include<iostream>
using namespace std;
 
int main(){
  int X;
  cin>>X;

switch ((X-2)%7) {
	case(0):
		cout<<"sat"<<endl;
		break;
	case(1):
		cout<<"sun"<<endl;
		break;
	case(2):
		cout<<"mon"<<endl;
		break;
	case(3):
		cout<<"tue"<<endl;
		break;
	case(4):
		cout<<"wed"<<endl;
		break;
	case(5):
		cout<<"thu"<<endl;
		break;
	default:
		cout<<"fri"<<endl;
		break;
}

  return 0;
}


Measured memory_bytes: 3136
import numpy as np
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n,k=IL()
h=np.array(IL())
dp=np.full(n,pow(10,6),dtype=int)
dp[0]=0
for i in range(1,n):
    t=i-min(i,k)
    dp[i]=np.min(dp[t:i]+abs(h[t:i]-h[i]))
print(dp[n-1])

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

int main() {
    int d, w;
    while (cin >> d >> w, d) {
        vector<vector<int>> e(d, vector<int>(w));
        for (int i=0; i<d; ++i)
            for (int j=0; j<w; ++j)
                cin >> e[i][j];

        int cap = 0;
        for (int i=0; i<d; ++i) for (int j=0; j<w; ++j)
            for (int k=i+2; k<d; ++k) for (int l=j+2; l<w; ++l) {
                int mn = INT_MAX, mx = 0, sum = 0;
                for (int y=i; y<=k; ++y) {
                    for (int x=j; x<=l; ++x) {
                        if (x == j || x == l || y == i || y == k) {
                            mn = min(mn, e[y][x]);
                        } else {
                            mx = max(mx, e[y][x]);
                            sum += e[y][x];
                        }
                    }
                }
                if (mn <= mx) continue;
                cap = max(cap, mn * (k-i-1) * (l-j-1) - sum);
            }

        cout << cap << endl;
    }
    return 0;
}


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

int main(){
	
	int a,b;

	
	cin>>a;
	cin>>b;
	
	if(3 != a && 3 != b){
		cout << 3;
	}
	if(2 != a && 2 != b){
		cout << 2;
	}
	if(1 != a && 1 != b){
		cout << 1;
	}
}

Measured memory_bytes: 256
# import math
# from itertools import permutations as permus
# from fractions import gcd

# import numpy as np
# import scipy as scp

times = 3
cardnums = []
for _ in range(times):
    cardnums = cardnums + list(map(int,input().split()))  # S += [input()] とも書ける

n = int(input())

times = n
bingonums = []
for _ in range(times):
    bingonums = bingonums + list(map(int,input().split()))  # S += [input()] とも書ける

for bingonum in bingonums:
    cardnums = [101 if cardnum == bingonum else cardnum for cardnum in cardnums]

def bingo_check(lis:list) -> str:
    if sum(lis[0:3])==303:
        return "Yes"
    if sum(lis[3:6])==303:
        return "Yes"
    if sum(lis[6:9])==303:
        return "Yes"
    if sum([lis[0],lis[3],lis[6]])==303:
        return "Yes"
    if sum([lis[1],lis[4],lis[7]])==303:
        return "Yes"
    if sum([lis[2],lis[5],lis[8]])==303:
        return "Yes"
    if sum([lis[0],lis[4],lis[8]])==303:
        return "Yes"
    if sum([lis[2],lis[4],lis[6]])==303:
        return "Yes"
    return "No"

ans = bingo_check(cardnums)
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


int main(){
	for (int d; cin >> d; ) {
		int ans = 0;
		rep(i, 600) if(i * d <= 600 - d) ans += (i * d) * (i * d) * d;
		cout << ans << endl;
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
using namespace std;
#include <algorithm>
#include <vector>
#include <cmath>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define per(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
#define absl(v) labs((v))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;if(n<r) return 0;rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1},dy[8]={0,1,0,-1,1,1,-1,-1};
#define downint greater<int>()
#define downchar greater<char>()
#define downstring greater<string>()
void tmpInit(int *c,ll m) {ll i;rep(i,m) c[i]=i;}
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1){
      res *= a; if(mod>=1) res %= mod;
    }
    a *= a; if(mod>=1) a %= mod;
    n >>= 1;
  }
  return res;
}
void initialize(){
  
}
int main(void){
  initialize();
  ll n,m,i,j,k,result=0;
  int a[LIMIT2]={0};
  char s[LIMIT1];
  
  cin >> n;
  //rep(i,n) cin >> a[i];
  result = pow(n,2);
  cout << result << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;



int main() {
    int n;
    cin >> n;
    string s;
    if (n == 0) {
        cout << 0 << endl;
        return 0;
    }
    while (n != 1) {
        if (abs(n)%2 == 0) {
            s += '0';
            n /= -2;
        }
        else {
            s += '1';
            n = (n-1)/-2;
        }
    }
    s += '1';
    reverse(s.begin(), s.end());
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 3620
def compute(scores)
  minmax = scores.minmax
  total = scores.inject(:+)
  total = total - minmax[0] - minmax[1]
  puts total / (scores.size - 2)
end

while num = gets.to_i
  break if num == 0
  n = 0
  scores = []
  while n < num
    scores.push(gets.to_i)
    n += 1
  end
  compute(scores)
end

Measured memory_bytes: 8688
// clang-format off

#include <bits/stdc++.h>

#define int long long int
#define main signed main()
#define bye return 0
#define rep(i, n) for (int i = 0; i < (n); i++)
#define each(p, v) for (auto p = (v).begin(); p != (v).end(); p++)
#define all(v) (v).begin(), (v).end()
#define cinv(v, n) rep(i, n) cin >> v[i]
#define prec(n) fixed << setprecision(n)
#define exact(x) { return (x); }

#define sum(v) accumulate(all(v), 0)
#define stlice(s, l) substr(s, s + l + 1)
#define odd(n) ((n) % 2)
#define even(n) (!((n) % 2))

#define INF 1e9
#define MOD (1e9 + 7)

#define pb push_back
#define mt make_tuple
#define fi first
#define se second
#define str string
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<str>

using namespace std;

// clang-format on

int f(int x, int y) exact(x <= y ? y - x : x - y + 2);

main {
  int x, y;
  cin >> x >> y;
  cout << min({f(x, y), f(-x, y) + 1, f(x, -y) + 1, f(-x, -y) + 2}) << endl;
  bye;
}


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

int fact[3000], finv[3000];

int mpow(int x, int y, int m){
    if(y==0) return 1;
    if(y==1) return x % m;
    if(y%2 == 0) return mpow(x*x%m, y/2, m);
    return mpow(x*x%m, y/2, m) * x % m;
}

int minv(int x, int m){
    return mpow(x, m-2, m) % m;
}

int comb(int n, int r, int m){
    return fact[n]*finv[n-r]%m*finv[r]%m;
}

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

    fact[0] = 1;
    for(int i=1;i<p;i++) fact[i] = i*fact[i-1]%p;
    finv[p-1] = mpow(fact[p-1], p-2, p);
    for(int i=p-2;i>=0;i--) finv[i] = (i+1)*finv[i+1]%p;

    static int64_t delta[3000][3000];
    for(int i=0;i<p;i++){
        delta[i][0] = (i==0)?1:0;
        for(int j=1;j<p;j++){
            delta[i][j] = (p - (comb(p-1, j, p)*mpow(p-i, p-1-j, p)%p)) % p;
        }
    }

    int64_t ans[3000] = {0};
    for(int i=0;i<p;i++){
        int a;
        cin >> a;
        if(a==0) continue;
        for(int j=0;j<p;j++) ans[j] = (ans[j] + delta[i][j]) % p;
    }

    for(int i=0;i<p;i++) cout << ans[i] << " \n"[i==p-1];
    
    return 0;
}

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

typedef long long ll;

#define int ll
#define all(v) v.begin(), v.end()
#define reps(__i, a, b) for (int __i = a; i < b; i++)
#define rep(__i, n) reps(__i, 0, n)

const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;

signed main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int e = c * d / __gcd(c, d);
    int sc = b / c - (a - 1) / c, sd = b / d - (a - 1) / d, se = b / e - (a - 1) / e;

    // cout << sc << "," << sd << "," << se << endl;
    cout << (b - a + 1) - (sc + sd - se) << endl;
}

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

using namespace std;

long long s, ans;

int main()
{	
	cin >> s;
	ans = s - 1;
	for (long long i = 1; i * i <= s; ++i)
		if (s % i == 0)
			ans = min(ans, i + s / i - 2);
	cout << ans << endl;
	return 0;
}

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

int main() {
  for ( int i = 0; i < 3; i++ ) {
    int h1, m1, s1, h2, m2, s2;
    cin >> h1 >> m1 >> s1;
    cin >> h2 >> m2 >> s2;
    s1 += h1*60*60 + m1*60;
    s2 += h2*60*60 + m2*60;
    s2 -= s1;
    cout << s2/3600 << " ";
    s2 %= 3600;
    cout << s2/60 << " ";
    cout << s2%60 << endl;
  }
  return 0;
}



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

typedef long long ll;
typedef long double ld;
#define size(a) int((a).size())
#define present(c, x) (c.find(x) != c.end()) 
#define printArray(arr) for (int i = 0; i<size(arr); i++) cout << arr[i] << '\n';cout << '\n'
#define printVerdict(verdict) cout << (verdict ? "YES": "NO") << '\n'
#define printDecimal(d) printf("%.9f\n", d)
#define inrange(val, start, end) (val >= start && val <= end)

const int inf = 0x3f3f3f3f;
const int mod = 998244353;

template <class T1, class T2, class T3> 
void printTuple(tuple<T1, T2, T3> t) {cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << '\n';}
template <class T1, class T2>
void printPair(pair<T1, T2> p) {cout << p.first << " " << p.second << '\n';}

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(0);
	int h,w; cin >> h >> w;
	int ch, cw, dh, dw; cin >> ch >> cw >> dh >> dw;
	ch--, cw--, dh--, dw--;
	char grid[h][w];
	for (int i= 0; i<h; i++) {
		string s; cin >> s;
		for (int j = 0; j<w; j++) grid[i][j] = s[j];
	}
	int dist[h][w];
	memset(dist, inf, sizeof(dist));
	dist[ch][cw] = 0;
	deque<pair<int, int>> Q;
	Q.push_back(make_pair(ch, cw));
	while (!Q.empty()) {
		pair<int, int> curr = Q.front();
		Q.pop_front();
		if (curr.first > 0 && grid[curr.first-1][curr.second] != '#' && dist[curr.first-1][curr.second] > dist[curr.first][curr.second]) {
			dist[curr.first-1][curr.second] = dist[curr.first][curr.second];
			Q.push_front(make_pair(curr.first-1, curr.second));
		}
		if (curr.first < h-1 && grid[curr.first+1][curr.second] != '#' && dist[curr.first+1][curr.second] > dist[curr.first][curr.second]) {
			dist[curr.first+1][curr.second] = dist[curr.first][curr.second];
			Q.push_front(make_pair(curr.first+1, curr.second));
		}
		if (curr.second > 0 && grid[curr.first][curr.second-1] != '#' && dist[curr.first][curr.second-1] > dist[curr.first][curr.second]) {
			dist[curr.first][curr.second-1] = dist[curr.first][curr.second];
			Q.push_front(make_pair(curr.first, curr.second-1));
		}
		if (curr.second < w-1 && grid[curr.first][curr.second+1] != '#' && dist[curr.first][curr.second+1] > dist[curr.first][curr.second]) {
			dist[curr.first][curr.second+1] = dist[curr.first][curr.second];
			Q.push_front(make_pair(curr.first, curr.second+1));
		}
		
		for (int i = max(curr.first-2, 0); i<=min(curr.first+2, h-1); i++) {
			for (int j = max(curr.second-2, 0); j <= min(curr.second+2, w-1); j++) {
				if (grid[i][j] != '#' && dist[i][j] > dist[curr.first][curr.second]+1) {
					dist[i][j] = dist[curr.first][curr.second] + 1;
					Q.push_back(make_pair(i, j));
				}
			}
		}
	}
	cout << (dist[dh][dw] == inf ? -1 : dist[dh][dw]) << '\n';
}


Measured memory_bytes: 8592
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main(){
    let x = read::<i64>();
    let mut v:Vec<i64> = Vec::new();
    for i in 1..1001{
        for j in 2..1001{
            if (i as i64).pow(j)  > x.into() {break;}
            v.push((i as i64).pow(j));
        }
    }
    println!("{}",v.iter().max().unwrap());
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin>>n;
    pair<pair<int,int>,int> a[n];
    for(int i=0;i<n;i++){
        cin>>a[i].first.first>>a[i].first.second>>a[i].second;
    }
    for(int i=0;i<=100;i++){
        for(int j=0;j<=100;j++){
            int l=0;
            int H=-1; int lub=INT_MAX;
            for(int k=0;k<n;k++){
                int r1=abs(i-a[k].first.first); int r2=abs(j-a[k].first.second);
                int h=a[k].second;
                if(h==0){
                    if(H!=-1 && H>r1+r2) break;
                    if(r1+r2<lub) lub=r1+r2;
                }
                else{
                    int k=h+r1+r2;
                    if(k>lub) break;
                    if(H==-1) H=k;
                    else{
                        if(H!=k) break;
                    }
                }
                l++;
            }
            if(l==n){
                cout<<i<<" "<<j<<" "<<H;
                return 0;
            }
        }
    }
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
m = 1
for i in range(n):
    if a[i] == 0:
        m = 0
        print("0")

if m == 1:
    for j in range(n):
        m = m * a[j]
        if m > 10**18:
            break
    if m > 10**18:
        print("-1")
    else:
        print(m)

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

int main() {
    ll a, b, c, k;
    cin >> a >> b >> c >> k;
    if(k % 2 == 0) {
        cout << a-b << endl;
    }
    else {
        cout << b-a << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=int (a);i<int (n);i++)
#define OUT  freopen("output.txt", "w", stdout)
#define IN  freopen("input.txt", "r", stdin)
#define mem(a,b) memset((a),(b),sizeof(a))
#define NumofDigits(n) ((int)log10(n)+1)
#define NumofBits(n) ((int)log2(n)+1)
#define PI 3.14159265358979323846264
#define vii vector<pair<int,int>>
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi  vector<int>
#define nl  cout<<"\n"
#define pb  push_back
#define mp  make_pair
#define ll  long long 
#define ss  second 
#define ff  first
#define endl "\n"
#define sp  " "
using namespace std;
	
int main(){
ios::sync_with_stdio(0);cin.tie(0);
int t=1; //cin>>t;
while(t--)
{
	
  ll n,cnt=0,ans=0; cin>>n;
  string s;cin>>s;
  rep(i,0,n)if(s[i]=='R')cnt++;
  rep(i,0,cnt)if(s[i]=='W')ans++;
  cout<<ans;
  
}

}


Measured memory_bytes: 3752
H, W, K = map(int, input().split())
grid = [input() for _ in range(H)]
ans = 0
for mh in range(1<<H):
    for mw in range(1<<W):
        count = 0
        for h in range(H):
            for w in range(W):
                if (mh>>h & 1) == 0 and (mw>>w & 1)==0 and grid[h][w]=='#':
                    count+=1
        if count==K:
            ans+=1
print(ans)

Measured memory_bytes: 73884
using System;
using System.Collections.Generic;

public class CSharp
{
    public static void Main()
    {
        Kyopuro chokudai = new Kyopuro();
        chokudai.AtCoder();
    }
}

public class Kyopuro
{
    public void AtCoder()
    {
        string[] input;
        input = Console.ReadLine().Split(' ');

        int n = int.Parse(input[0]);
        int k = int.Parse(input[1]);

        int b = 0;
        double t = 0;
        double ans = 0;

        for(int i=1; i<=n; i++)
        {
            b = 1;
            t = 1;
            while (i * b < k) b *= 2;
            t /= b;
            t /= n;
            ans += t;
            
        }
        Console.WriteLine(ans);

    }
    public static void DebugWL(object x) { System.Diagnostics.Debug.WriteLine(x); }
}


Measured memory_bytes: 11092
sum_gift = 0
Gift_lists = []
N = int(input())
for i in range(0, N):
    Gift_lists.append([x.strip() for x in input().split()])

for l in Gift_lists:
    if l[1]=='JPY':
        sum_gift += int(l[0])
    else:
        sum_gift += float(l[0])*380000.0
print(sum_gift)

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

using namespace std;

#define READ() 	    freopen("in.txt","r",stdin)
#define WRITE()     freopen("out.txt","w",stdout)
#define sf(n) 	    scanf("%d",&n)
#define sl(x)       scanf("%I64d",&x)
#define lsf(n) 	    scanf("%lld", &n)
#define pb(n) 	    push_back(n)
#define EPS 	    1e-10
#define INF         INT_MAX
#define MAX         INT_MAX
#define MOD         1000000007
#define LL          long long
#define endl        "\n"
#define pi          2.0*acos(0.0)
#define cnd         tree[idx]
#define lnd         tree[left]
#define rnd         tree[right]
#define callLeft    left,st,mid
#define callRight   right,mid+1,ed


int main()
{
//	ios_base::sync_with_stdio(false);
//    cin.tie(0); /// use "\n" instead of endl
//    READ();
//    WRITE();

    string s;
    cin >> s;

    for(int i=0;i<4;i++)
    {
        cout << s[i];
    } cout << " ";
    for(int i=4;i<s.size();i++)
    {
        cout << s[i];
    }
//    cout << " ";
    cout << endl;


    return 0;
}


Measured memory_bytes: 256
K, A, B = map(int, input().split())

ans = min(A, K)
cnt = min(A - 1, K - 1)
res = K - cnt
if B - A >= 2:
    ans += (B - A) * (res // 2)
    ans += res % 2
else:
    ans += res

print(ans) 

Measured memory_bytes: 3060
N,M=map(int,input().split())

mp = {}
for i in range(M):
    P,Y=map(int,input().split())
    if not P in mp:
        mp[P] = []
    mp[P].append((Y,i))

res = ['']*M
for k, li in sorted(mp.items()):
    for i, (y, l) in enumerate(sorted(li)):
        res[l] = '{:06d}{:06d}'.format(k, i+1)

for st in res: print(st)


Measured memory_bytes: 50248
#include<stdio.h>
int main(void)
{
	int A,B,C,D,N,c[101]={0},i,j,temp,max,x,y,goukei[200],n;
	scanf("%d %d %d %d",&N,&A,&B,&D);
	for(C=0;C<N;C++){
		scanf("%d",&c[C]);
	}
	for(i=0;i<N-1;i++){
		for(j=N-1;j>i;j--){
			if(c[i]<c[j]){
				temp=c[j];
				c[j]=c[i];
				c[i]=temp;
			}
		}
	}
	x=D;
	y=A;
	for(i=0;i<N;i++){
	x=x+c[i];
	y=y+B;
	goukei[i]=0;
	goukei[i]=x/y;
		}
	max=D/A;
	for(i=0;i<N;i++){
		if(goukei[i]>max){
			max=goukei[i];
		}
	}
	printf("%d\n",max);
	return 0;
}

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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)

int main()
{
    lint n;cin >> n;
    vector<lint> b(n),v(n);
    REP(i, n) { cin >> b[i]; }
    lint ans=0;

    REP(i,n){
        int zero = 0;
        int x=0;
        int y;
        REP(j, n)
        {
            if(j+1-zero==b[j]){
                x = j+1-zero;
                y = j;
                //break;
            }
            if(b[j]==0){
                zero++;
            }
        }
        if(x){
            b[y] = 0;
            v[i] = x;
        }else{
            cout << -1 << "\n";
            return 0;
        }
    }

    IREP(i,n){
        cout << v[i] << "\n";
    }

    //cout << ans <<"\n";

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<array>
#include<algorithm>
#include<list>
#include<cmath>
#include<iomanip>
#include<queue>
#include<functional>
#include<climits>
#include<iterator>
#include<unordered_set>
#include<unordered_map>
#include<map>
#include<set>
#include<typeinfo>
using namespace std;

const double pi=4*atan(1.0);

constexpr long long mod=static_cast<long long>(1e9+7);

using cEdges=vector<vector<pair<int,int>>>;

int main() {
	int N;
	cin>>N;
	vector<int> a(2*N);
	for(auto& val:a)
		cin>>val;

	sort(begin(a),end(a));
	int ans=0;
	for(int i=0;i<N;++i){
		ans+=a[2*i];
	}

	cout<<ans<<endl;
	//system("pause");
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
int main(void){
  int posa, posb;
  bool fail = false;
  string s;
  cin >> s;
  
  posa = -1 + (s.size() - 1) / 2;
  posb = -1 + (s.size() + 3) / 2;
  for(int i=0; i<(s.size() - 1) / 2; i++){
    if(s.at(i)!=s.at(posa-i)){
      fail = true;
    }
    if(s.at(posb+i)!=s.at(s.size()-1-i)){
      fail = true;
    }
  }
  for(int i=0; i<(s.size() - 1) / 2; i++){
    if(s.at(i)!=s.at(s.size()- 1 - i)){
      fail = true;
    }
  }
  if(fail) cout << "No" << endl;
  else cout << "Yes" << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iomanip>
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define all(a) (a).begin(),(a).end()
#define vecin(a) rep(i,a.size())cin >> a[i]
#define vecout(a) rep(i,a.size()){cout << a[i];cout << (i == a.size() - 1 ? "\n":" ");}
#define rep(i,x) for(ll i = 0;i<x;i++)
#define REP(i,x) for(ll i = 1;i<=x;i++)
#define mp make_pair
#define debug(x) cerr << #x << ": " << x << "\n"
using ll = long long;
using ld = long double;
using namespace std;
using dou = double;
const ll inf = 2147483647;
const ll INF = 1LL << 60;
const dou pi = 3.14159265358;
const ll mod = 1000000007LL;
//const ll mod = 998244353LL;
typedef pair<ll,ll> P;
using graph = vector<vector<ll>>;
template<class T, class U> inline bool chmin(T& a, const U& b){ if(a > b){ a = b; return 1; } return 0; }
template<class T, class U> inline bool chmax(T& a, const U& b){ if(a < b){ a = b; return 1; } return 0; }
template<class T, class U> inline bool change(T& a,U& b){if(a > b){swap(a,b);return 1;}return 0;}
//0の場合のアレンジに注意
template<class T>
T gcd(T a,T b){
    if(a == 0)return b;
    else if(b == 0)return a;
    if(a < b)swap(a,b);
    if(a % b == 0)return b;
    else return gcd(b,a%b);
}
template<class T>
T lcm(T a,T b){
    return a / gcd(a,b) * b;
}

//素数判定O(sqrt(N))
template<class T>
inline bool isp(T n){
    bool res = true;
    if(n == 1)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}
const ll cmax = 1000000;
vector<ll> fac(cmax),finv(cmax),inv(cmax);

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < cmax; 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;
    }
}

// 二項係数計算
ll nCk(ll n, ll k){
    if(fac[0] == 0)COMinit();
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
//nのm乗をMODで割ったあまりO(logm)
ll modpow(ll n,ll m,ll MOD){
    if(m == 0)return 1;
    if(m < 0)return -1;
    ll res = 1;
    while(m){
        if(m & 1)res = (res * n) % MOD;
        m >>= 1;
        n *= n;
        n %= MOD;
    }
    return res;
}
ll mypow(ll n,ll m){
    if(m == 0)return 1;
    if(m < 0)return -1;
    ll res = 1;
    while(m){
        if(m & 1)res = (res * n);
        m >>= 1;
        n *= n;
    }
    return res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll N;
    cin >> N;
    vector<ll> V(N),C(N);
    vecin(V);vecin(C);
    rep(i,N){
        V[i] -= C[i];
    }
    ll ans = 0;
    rep(i,N){
        if(V[i] > 0){
            ans += V[i];
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 26512