Submission

Status:

[P][P][P][P][P][P][P][P][PP][P]

Subtask/Task Score:

{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}

Score: 100

User: anonymous

Problemset: กองส้ม

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-21 13:43:53

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

int main(){
    int l,n; cin >> l >> n;
    float x = cbrt(3*n) - 0.5;
    x -= (2*x*x*x + 3*x*x + x - 6*n) / (6*x*x + 6*x + 1);
    cout << l - (int)x;
}