Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 16th, 2018 76 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. For c and c++ try this-
  2.  
  3. Create a file named input.txt in the same folder as your solution program(.c or .cpp file) is in. Copy and paste the testcases in this file and then save the file.
  4. Now modify your code this way-
  5.  
  6. // your include statemnts
  7. #include<time.h>
  8. #include<stdio.h>
  9.  
  10. int main()
  11. {
  12.     freopen("input.txt","r",stdin);
  13.     double start=clock();
  14.     /*
  15.  
  16.         your solution code here
  17.  
  18.     */
  19.     double end=clock();
  20.     printf("\n\nTotal runtime = %lf ms",(end-start)*1000/CLOCKS_PER_SEC);
  21.     return 0;
  22. }
  23.  
  24. Now compile and run the program.
  25.  
  26. # Don't forget to remove the freopen(...) statement before submitting your code
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top