Qualified's blog

By Qualified, 4 years ago, In English

Do you write your own C++ code for cin and cout? Maybe operator overloading, templates. Like Benq. What is the code for them? Sorry for bad english. :P

Full text and comments »

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

By Qualified, 4 years ago, In English

Why not use

#include <bits/extc++.h>

It has all of the policy based data structure "includes" in these articles Implicit cartesian tree in GNU C++ STL C++ STL: Policy based data structures and everything included in

#include <bits/stdtr1c++.h>

and

#include <bits/stdc++.h>

Also, with precompiled headers, it runs in about the same time as

#include <bits/stdc++.h>

Link to the file of

#include <bits/extc++.h>

Full text and comments »

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

By Qualified, history, 4 years ago, In English

The title says it all...

Full text and comments »

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

By Qualified, history, 4 years ago, In English

Many times, I get WA but don't know where to start when debugging, do you guys have a test case generator? Or something like that? Thanks!

Full text and comments »

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

By Qualified, history, 4 years ago, In English

By script, I mean what method do you use to stress test your solution(code maybe?)

Full text and comments »

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

By Qualified, history, 4 years ago, In English

In USACO, what would the ratings of the problems be on CF? Any thoughts? Like bronze problems are xyz rating silver problems are this much rating.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

I am seeing many blogs about precompiled headers and how it can decrease compilation time. I am wondering how do I do this on Vim in Windows? Thanks in advance.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

Have you ever wondered how to make your very own template? In all of the other IDEs like VSCode, Sublime have templates in which you type in a set string of characters like "cpp" and then your template appears. This is actually very simple and only requires one line of code in your .vimrc

nnoremap cpp :-1read ABC<CR>

where "ABC" is the location of that file containing your template. The "cpp" after "nnoremap" actually determines what you should type into vim in order for your template to appear. For example:

nnoremap cpp :-1read C:\Users\Qualified\Desktop\Template\template.cpp<CR>

where Qualified is the name of my computer and Template is the folder which contains the template.cpp file which holds my template.

Hope that this helped many people!

Full text and comments »

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

By Qualified, history, 4 years ago, In English

What is your compiler flags when using Vim for C++? Where do you put them?

Full text and comments »

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

By Qualified, history, 4 years ago, In English

When I'm using:

#define rep(i, a, b) for(int i = a; i < b; i++)
#define per(i, a, b) for(int i = a; i >= b; i--)

how do I do

for(;;)

with the

rep(i, a, b)
per(i, a, b)

Full text and comments »

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

By Qualified, history, 4 years ago, In English

Mine was when I got a +45 rating change. Although that isn't a lot, I finally improved. Look at rating graph, kinda trash. I want to hear yours.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

I've been seeing a lot of people using debug templates but when I copy and paste it, I don't know how to use it. Is there anything that I should know? Thanks in advance.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

When you get a WA on a testcase, do you look at the test case that you failed at or do you simulate a contest by not looking at the test cases. Thanks in advance.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

I'm wondering which method is better. Thanks in advance.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

Is there a difference between std::array like array<int, 2> MyArray = {1, 2}; and int arr[2] = {1, 2}; Time complexities? Different functionalities?

Full text and comments »

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

By Qualified, history, 4 years ago, In English

I am doing C-Maximal Value. How would you construct the greedy algorithm? Thanks in advance.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

I see people using "ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);" I personally use "ios::sync_with_stdio(0); cin.tie(0);" without the "cout.tie(0);". What is the difference? Is the first option faster than the second?

Full text and comments »

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

By Qualified, history, 4 years ago, In English

Is there a difference in time between the two methods? Which one is better and why?

Full text and comments »

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

By Qualified, history, 4 years ago, In English

Is there a difference between puts("Hi"); and cout << "Hi"; in time complexity or any benefit of using one over the other?

Full text and comments »

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

By Qualified, history, 4 years ago, In English

Hi, I am trying to do 723B - Text Document Analysis and here is my code.

Code

When I input 37, which is the example input, the program just returns maxx and cnt. I don't understand this. Am I doing something wrong. BTW I am using GVim.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

I would always do if I wanted to insert 'a' into the beginning of the string. reverse(s.begin(), s.end()); s += 'a'; reverse(s.begin(), s.end()); Is there a built-in function to insert a character in the beginning of a string?

Full text and comments »

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

By Qualified, history, 4 years ago, In English

Many problems require the use of finding the adjacent cells of a cell regarding boundaries. Is their an easy way to do this?

Full text and comments »

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

By Qualified, history, 4 years ago, In English

I am doing 1066A - Vova and Train and I am using Gvim. Here is my source code below.

Code

It always says 'terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc shell returned 3

Need help! Thanks in advance! Don't know why the font is weird for my code.

Looks like it works when I run it through the sample test cases. Submission says Memory Limit Exceeded.

Full text and comments »

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

By Qualified, history, 4 years ago, In English

First off, you need to learn the basic commands of vim which can be learnt from vimtutor or Vim Adventures. Then you can install the latest version of Vim Vim Download. Next you can learn some basic commands for your .vimrc which can be located by entering "version" in normal mode. Then it will say "user vimrc file". Next you will remember the directory of the .vimrc file which is to the right of "user vimrc file". Then type ":e " then the directory of the vimrc file. A blank page will pop up. Here you can do all sorts of stuff, such as setting line numbers, configuring tabspaces and all sort of things.

Full text and comments »

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