fork download
  1. /*
  2. Silly Mistakes
  3. 1. Wrong array size(100 instead of 101)
  4. 2. Wrong variable used due to typing mistake(j instead of i)
  5. 3. i/25 is not equal to i/25.0
  6. 4. Using variables which have garbage values
  7. 5. Not using constants like l for double and LL for long long
  8.  
  9. Silly Hacks
  10. 1. Applying hack when some unknown function is used
  11. 2. Wrong analysis of complexity and doing hack thinking it will give TLE
  12.  
  13. Before Contest
  14. 1. One hour rest
  15. 2. Poop!
  16. 3. Files ready in CB
  17. 4. Full Stomach
  18.  
  19. During contest
  20. 1. First solve all problems, then lock and hack.
  21. 2. Avoid wrong hacks
  22.  
  23. After contest
  24. 1. Upsolve
  25. */
  26. #include<bits/stdc++.h>
  27. using namespace std;
  28. #define sc scanf
  29. #define pr printf
  30. #define wh while
  31. #define ll long long
  32. #define ull unsigned long long
  33. #define lld I64d
  34. #define mp make_pair
  35. #define ff first
  36. #define ss second
  37. #define vc vector
  38. #define pb push_back
  39. #define st string
  40. #define bl bool
  41. #define tr true
  42. #define fl false
  43. #define read freopen("in.txt","r",stdin)
  44. #define write freopen("out.txt","w",stdout)
  45. #define fast ios_base::sync_with_stdio(false)
  46. #include<bits/stdc++.h>
  47. using namespace std;
  48. int n;
  49. vector <string> z;
  50. size_t found;
  51. void solve(int start,string b)
  52. {
  53. string c=b;
  54. if(start==n) z.pb(b);
  55. else
  56. {
  57. c=b+"A";
  58. solve(start+1,c);
  59.  
  60. c=b+"C";
  61. solve(start+1,c);
  62.  
  63. c=b+"G";
  64. solve(start+1,c);
  65.  
  66. c=b+"T";
  67. solve(start+1,c);
  68. }
  69. }
  70. class TopBiologist
  71. {
  72. public:
  73. string findShortestNewSequence(string sequence)
  74. {
  75. for(n=1;n<=6;n++) solve(0,"");
  76. int l=z.size();
  77. for(int i=0;i<l;i++)
  78. {
  79. found=sequence.find(z[i]);
  80. if(found==string::npos) return z[i];
  81. }
  82. }
  83. };
  84.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i586-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty