eduarc's blog

By eduarc, 7 years ago, In English

Hi everyone!

I coded a solution for the problem 337B - Бытовая задача, this is the submission 5969979.

I got AC although i misspelled the third condition a*d > c*d instead of a*d > c*b. Then my solution fails for the test case 3 1 3 2 for example.

I think this kind of errors must be caught up in the system test.

Thanks!

Read more »

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

By eduarc, 7 years ago, In English

Hi! See this useful C++ include directive.

#include <bits/stdc++.h>

This let you use any C/C++ standard library without adding extra "includes". No more compilation errors because missing libraries :)

And you can make a shorter version of your template. For example, my template.

  #include <bits/stdc++.h>
  #define _ ios_base::sync_with_stdio(0);cin.tie(0);

  using namespace std;

  int main() { _

    return 0;
  }

I tested it with the GNU/C++ compiler.

More information:

Headers — GCC Documentation

Header file definition:

Linux GCC 4.8.0

Windows MinGW 4.6.1

Read more »

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