NotStack's blog

By NotStack, history, 7 hours ago, In English

Utsav_Kashyap Bro started div2 contest almost after 50 mins and still solved 6 problems, GOD level thinking. In just 2 months bro become candidate master and may be GM or IGM in next 2 to 3 months I guess. Bro you should join some plateform to teach noob coders like us so that we can reach pupil or specialist to feel that happiness as you've. LMAO, I don't even have words, what to say, people already said alot.

AmmarAhmedTheSaviour Bro couldn't able to solve this simple Problem E. in div 4 which have over 3000+ submissions E. Skibidus and Rizz but bro solved the hardest problem F. in div 2 which have only 270 submissions F. Bitwise Slide. And the best part is He gave only 2 contest till now and solved 6 problems in div 2 and only 5 problems in div 4 and not even have a single wrong answer on any problem, OMG. And He is still defending himself, I want this level of confidence. and also, Cheater can afford compilation error but can't afford a single wrong answer on any test case.

tiwariakshay590 Bro solved problem C. Devyatkino with 4D DP which can be solved in just 5 to 8 lines using greedy. He solved this problem using 4D DP because the tiwariakshay590 is buyer and bdyby1009 is seller. Buyer Solution Problem C and seller solution Problem C is completely matched. Now He is defending himself saying that he've done pure hardwork and become expert on codeforces. And for problem F submission F — Bitwise Slides, he is commenting on some stupid things which he says, like telling us // Namespace for utility functions and constants // Custom macros for concise loops // Solution encapsulated within a class for better code organization // To handle multiple test cases, uncomment the line below Bro have so much time that he wrote all these stupid comments to tell us that this works for this and this works for that. Only gpt can write these fuc*** stupid things.

vin_esh_32 He registered some 4 months ago on codeforces. Bro was getting 16553 rank, 9636 rank, 9481 rank etc by solving just 1 problem in div.2 contest. Bro couldn't able to solve even 1000 rated or 1100 rated problems in previous contest but He solved 6 problems in yesterday div. 2 contest. Unbelievable and got rank 10(2 digit) globally. Bro got success over the nights. The journey from 16000 rank to rank 10, The journey of not solving a 1100 rated problem to solve a problem 2500 or 2600 rated problem(because there are 200 submissions only). And the best part is bro don't even get a single wrong answer in any problem submissions even tourist benq jiangly can get WA on solving straight 6 or 7 problems. And the last part, vin_esh_32 is buyer and this is seller bdyby1009, because the solutions are matching totally.

Those all cheater solved Problem E and F in the last 5 to 8 mins because the seller himself couldn't solve early, Even Seller submitter the problem E and F with in last 3 or 5 mins.

I can write a story of all these cheaters with a proof, but I think it is enough. There is no way to stop this.

For more names of cheater refer to this blog : Please ban those cheaters!!!!

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it

By NotStack, history, 7 weeks ago, In English

Guys, Is this possible that, Same code 5 months before passed all the test cases and got AC under the time limit, but now that same piece of code giving me huge TLE ?? if this is possible then how, is it due the may be new test cases got added ???

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

By NotStack, history, 3 months ago, In English

I've been solving this problem name 225B - Well-known Numbers, I coded and submit it but got wrong answer on test case 33, then I went to see that test case and run locally in sublime, but I've got the output correct and different from the output that I was getting after submission.

How is this possible and why ??? I've got the correct answer and after submission it shows different and may be that's why I'm getting wrong output.

And the test case is : 989464701 4

Can somebody check this out ?

This is my code :

// x.cpp

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

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

using namespace __gnu_pbds;

#define MOD 1000000007
#define MOD1 998244353
#define INF 1e17
#define endl "\n"
#define nline cout << endl
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define pll pair<ll, ll>
#define PI 3.141592653589793238462
#define set_bits(x) __builtin_popcountll(x)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define pbds tree<pair<ll, ll>, null_type, less<pair<ll, ll>>, rb_tree_tag ,  tree_order_statistics_node_i - 1date>

// -------------------------------------------------------------------------------------------------------//

template <typename T> void read(T& t) { cin >> t; }
template <typename T, typename... Args> void read(T& t, Args&... args) { read(t); read(args...); }
template <typename T> void read(vector<T>& vec) { for (auto& element : vec) { cin >> element; } }
template <typename T> void print(const T& t) { cout << t << " "; }
template <typename T, typename... Args> void print(const T& t, const Args&... args) { print(t); print(args...); }
template <typename T> void print(const vector<T>& vec) { for (const auto& element : vec) { cout << element << " "; } cout << "\n"; }

// -------------------------------------------------------------------------------------------------------//

using ll = long long;
using ull = unsigned long long;
using lld = long double;

void solve() {
	ll s, k;
	read(s, k);
	vector<ll> ans, kbonacci;

	if (k > 32) {
		ll val = 1;
		kbonacci.pb(0);
		while (val <= s) {
			kbonacci.pb(val);
			val *= 2;
		}
	}
	else {
		vector<ll> b(k, 0);
		b[k - 1] = 1;
		kbonacci.pb(0);
		kbonacci.pb(1);

		while (1) {
			ll next = 0;
			for (ll i = b.size() - k; i < sz(b); i++) {
				next += b[i];
			}
			if (next > s) break;
			kbonacci.pb(next);
			b.pb(next);
		}
	}

	// print(kbonacci);
	set<ll> st;
	for (ll i = sz(kbonacci); i >= 0 && s > 0; i--) {
		if (kbonacci[i] <= s and st.find(kbonacci[i]) == st.end()) {
			s -= kbonacci[i];
			ans.pb(kbonacci[i]);
			st.insert(kbonacci[i]);
		}
	}

	if (sz(ans) == 1)
		ans.pb(0);
	print(sz(ans)); nline;
	print(ans);
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ll tc;
	tc = 1;
	// read(tc);
	for (ll i = 1; i <= tc; i++) {
		solve();
	}

	return 0;
}

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

By NotStack, history, 3 months ago, In English
  • I have this doubt from a very long time about tags of the problems.
  • when problem have tags like dp, greedy and brute force (1600+ rated problems), so is it really mean that the problem can be solved independently with these tags.
  • Does that mean, I can solve the problem using just greedy approach without some precomputation of dp or any brute force.
  • How these tags decided ?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By NotStack, history, 3 months ago, In English
  • I was solving this problem from the last 2 hour almost -> 1334C - Circle of Monsters
  • I made quite submissions but I was getting TLE for my code.
  • Then I looked for some red coders solution and the thing is the logic and implementation was same, but I still submit the red coder's code and I'm surprised that IT STILL GOT TLE WHY ?
#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define ff first
#define ss second

void solve() {
    ll n; cin >> n;
    vector<ll> a(n), b(n);
    for (ll i = 0; i < n; i++)
        cin >> a[i] >> b[i];
    vector<ll> cost(n, 0);
    for (ll i = 0; i < n; i++)
        cost[i] = max(0LL, a[i] - b[(i + n - 1) % n]);

    ll sum = accumulate(cost.begin(), cost.end(), 0LL);
    ll ans = (ll)1e18;
    for (ll i = 0; i < n; i++) {
        ans = min(ans, sum - cost[i] + a[i]);
    }
    cout << ans << endl;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ll tc;
    cin >> tc;
    while (tc--)
        solve();
    return 0;
}
  • I don't know what's the problem in this very simple and clean code and still I'm facing this issue.
  • Can anyone please consider this problem and tell me, why it is giving me TLE ?

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By NotStack, history, 3 months ago, In English

CSES Problem runtime Error :

Today, I was solving a CSES problem named Book Shop which is a standard DP problem, But I'm getting runtime error on same solution when I'm using long long instead of int. I'm not able to figure the reason, why it is not working.

But working with the same solution when I used int and it got accepted.

Can anybody just tell me the exact reason and when these types of problems can occur ?

Here is the code that gives me runtime error (used long long everywhere)

// A.cpp
 
#include<bits/stdc++.h>
using namespace std;
 
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e17
#define endl "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define PI 3.141592653589793238462
#define set_bits(x) __builtin_popcountll(x)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
 
using ll = long long;
using ull = unsigned long long;
using lld = long double;
 
void solve() {
	ll n, x;
	cin >> n >> x;
 
	vector<pair<ll, ll>> arr(n + 1);
	for (ll i = 1; i <= n; i++)
		cin >> arr[i].ff;
	for (ll i = 1; i <= n; i++)
		cin >> arr[i].ss;
 
	vector<vector<ll>> dp(n + 1, vector<ll>(x + 1, 0LL));
 
	for (ll i = 1; i <= n; i++)
		for (ll j = 1; j <= x; j++)
			dp[i][j] = (j >= arr[i].ff ? max(dp[i - 1][j], dp[i - 1][j - arr[i].ff] + arr[i].ss) : dp[i - 1][j]);
 
	cout << dp[n][x] << endl;
}
 
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ll tc;
	tc = 1;
	// cin >> tc;
	for (ll i = 1; i <= tc; i++) {
		solve();
	}
 
	return 0;
}

Is it due to strict memory guidelines on CSES ? So I need to use int for most of the problems.

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it