And I hope you have a good new year and high ratings. Also, I hope you quit codeforces, touch grass, and get a job.
# | User | Rating |
---|---|---|
1 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 166 |
3 | Um_nik | 161 |
3 | atcoder_official | 161 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
And I hope you have a good new year and high ratings. Also, I hope you quit codeforces, touch grass, and get a job.
Most people have starter files. Some people's starter files are hard to understand and long (which is a good thing), and others don't even use them. Mines is quite confusing.
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#include <sys/resource.h>
#endif
using namespace std;
#define debug(a) cerr << a << endl;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) a.size()
typedef unsigned u;
typedef long long ll;
void solve()
{
}
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
ostringstream output;
streambuf* cout_buffer = cout.rdbuf();
cout.rdbuf(output.rdbuf());
#endif
int t = 1; //cin >> t;
while (t--) solve();
#ifndef ONLINE_JUDGE
cout.rdbuf(cout_buffer);
cout << "***************************" << endl << output.str();
cerr << "---------------------------" << endl << "Time: " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
struct rusage usage;
getrusage(RUSAGE_SELF, &usage);
cerr << "Memory: " << usage.ru_maxrss << " KB" << endl;
#endif
return 0;
}
Most people use the Codeforces editor (and it's perfect). I use Vim (don't ask why), so unlike VS-Code, I can't just make an input and output file, so I separate the input from the output. The #include <sys/resource.h>
library is for memory usage, it's a bit different in Windows, but this is the Linux approach. If there's a way it improve it, can you please tell me?
I tested the same solution on a problem that needed summing up long long
s.
As you can see, both C++23 and C++17 ran in 154 ms and took up 100 KB. But C++20 is the best option here. That's why I use C++20 and recommend you do so too! If you agree, upvote, and if you don't, downvote.
#include <bits/stdc++.h>
using namespace std;
#define debug cout << "I was here!" << '\n'
#define all(a) a.begin(), a.end()
typedef unsigned u;
typedef long long ll;
void solve()
{
int n; cin >> n;
ll ans = 0;
for (int i = 0; i < n; i++)
{
ll a; cin >> a;
ans += ((a - 1) * i) + a;
}
cout << ans << '\n';
}
int main()
{
int t = 1; //cin >> t;
while (t--) solve();
return 0;
}
And this is the problem.
I just started anime, and now I understand why some programmers like anime. Cause it saves you your sanity. Why do you think?
Nowadays, people are mostly used to dark themes. For example, you were reading some documentation in geeksforgeeks then you open codeforces and you get flash banged so hard.
#inclsude <iostream>
#include <fstream>
#include <vector>
using namespace std;
#define cin input
#define cout output
ifstream input("D:/CP/input.txt");
ofstream output("D:/CP/output.txt");
void solve()
{
}
int main() {
int t = 1; //cin >> t;
while (t--) solve();
input.close();
output.close();
return 0;
}
Let's say I write some code in the "solve" function. I check the example tests and if they pass, I submit BUT I comment the #define cin input
and the #define cout output
so the code can work WITHOUT text files
Now a day's there is many cheaters out there. But one question: Why? Contests are about getting better at solving problems by giving you challenging new problems so why would you want to cheat? Just to be smug about it? And if so, why here? In a place where people solve problems. What good will it bring you. UPD: Not Minecraft. mc is gud. UPD: Just dont cheat, like at all
After Writing a bit of code, the compiler stops working. Sometimes a refresh fixes the problem, but most of the times it does not work. Please MikeMirzayanov Fix this problem with the others (Cloudflare stopping submission, submission queue, etc).
Hello Codeforces!
Has anyone got a long queue of submission? I would be surprised if it didn't happen to you. It has been increasing in numbers! It even happened in contest! (Div. 3). Please MikeMirzayanov fix this issue!
Me and many others have expiriened the problem with "in queue...". we wait there from 1 minute to a whole hour JUST to submit, like seriasly, we need to update the jugding system cause sometimes we have lag there. when it first happened to me 3 months ago, I thought it was because of the internet. BUT NOW everyone has this lag sometimes. I think MikeMirzayanov should look alittle more on this anoying problem.
why?!? u might be asking, well... because if u know advanced math, when u open a math problem u just need to think and KABOOM, u solved it in less than 10 minutes! also because most problem (ABC & ABCD) in div 2 and 3 are math problems. for beginners (like me) u should start by working on algebra, combinatorics, and number theory problems numbered 1-5 on the AIME. it really helped me.
bruh, we need to get better at solving problems, here are some tips to help: when u open a problem, u need to not be lazy if its too hard for u; better just solve it. also u should train ur weaknesses, for example mines is math, so i need to filter problems on math. Remember, in coding u shall not have a weak side. and also dont ONLY do div 3, 4. do div 2 too, because if u solved a few problems u might have seen that some 800-1000 ratings problems are from div 2! also most ABC problems in div 2 are math so u should strenthen it, and not make it weaker like me (;
If u agree please like cause ive got -47 there!
99 days left...
Hello Codeforces! Can anyone guess the language (Please no google translate)? Comment down bellow! This is day 2 of my blog series
I think I should learn a new method.
Prefix Sum and Binary Search
Also problem 1 in Div.4 is probably is gonna be the new easiest problem on Codeforces. Then goes Watermelon.
(Wonder what problems are gonna be in April Fools)
For me, Div.4 was very successful! Surprisingly, I solved the first four easily. But the ratings haven't come yet..
UPD: CREDITS TO Norp!!! MAY EVERYONE HAVE HIGH AND LUCKY RATINGS!!!
Chao to all!
100 Days left...
Before I can talk about this new blog series, we all have to thank MikeMirzayanov for such an AMAZING website for CP.
While I was looking at my blogs I saw a blog "Pupil in 80 days", and I thought "Wow! What an amazing idea for a blog series!". And here is me 10 days later making an amplified version.
All I am doing today is solving problems (900 — 1100) to prepare for Div.4.
If any of you have some great TWISTS for this challenge, please comment down bellow.
So this is credits where I will credit any people who gave ideas in comments and etc.
If you want to be in the Credits just give an idea. (and I have to accept it);
Chao to all!
Every onewho is div4. (like me): Good Luck! Div4. is tomorrow. hope for every one good luck. also, I wonder what problems are gonna are be in april fools contests?
I was looking in blogs and I saw this blog... I looked at chat, and there was and ISLAMIC terorist. Why are they even in a CP site anyway??? Why isn't MikeMirzayanov doing anything to it? I herd in the news that Islamic terrorists from tajikistan killed about 131 people in Russia (I was very andgry and sad about this news cause I am a tajik). And it is all cause of money. I think MikeMirzayanov should make a username checker for swear words.
Nowadays, I see bad usernames with bad words (exp: f*ck). I think MikeMirzayanov should change the rules about usernames.
I am stuck solving 800 and 900 ratings. What should I do?
mines is 6; whats is urs?
Why??? You might be asking... well, std::endl is the most common thing that might be giving you TLE. It's because std::endl flushes every time. But on the other hand, '\n' only flushes once every 1000 times because is is just a newline character. But if you are used to writing std::endl
or endl
, you can just make a define for it. #define endl "\n"
. If you think I am wrong, just comment, don't dislike.
please comment down bellow
The reason that C++20 is better than C++17 is that C++20 is twice as fast when you are using long long because C++20 in codeforces is 64-bit (acording to this blog). The faster we get C++20 the better (if you agree vote : i like it) and please anyone dont dislike me
anyone who knows please comment? also PLEASE RETURN IT MikeMirzayanov (C++20)!!!!!
unsigned long long factorial(unsigned int x) {
if (x == 0 || x == 1) return 1;
return x * factorial(x - 1);
}
Name |
---|