fork download
  1. #include<iostream>
  2. #include<vector>
  3. #define nl '\n'
  4. #define debug cout<<"yo\n"
  5. #define pb push_back
  6. typedef unsigned ui;
  7. typedef long long ll;
  8. typedef unsigned long long ull;
  9. using namespace std;
  10. typedef vector<int> vi;
  11. typedef vector<unsigned> vui;
  12. typedef vector<long long> vll;
  13. typedef vector<unsigned long long> vull;
  14.  
  15. /*
  16.   Author: shardic
  17.   Indian Sports Programming Championship: SISSUES
  18.   Date: 24-11-2018
  19.   Time: 18:43
  20. */
  21.  
  22. int main()
  23. {
  24. ios::sync_with_stdio(false); //TIME IS EVERYTHING
  25. cin.tie(0); //TIME IS EVERYTHING
  26. int t;
  27. cin >> t;
  28. while(t--)
  29. {
  30. int a = 0, n;
  31. char c;
  32. bool b;
  33. cin >> n;
  34. while(n--)
  35. {
  36. cin >> c;
  37. if(b)
  38. {
  39. a += (c == '+') ? 1 : -1;
  40. b = (a >= 0) ? true : false;
  41. }
  42. }
  43. cout << ((b) ? "MAYBE YOU ARE SAFE" : "FIND A NEW JOB") << nl;
  44. }
  45. return 0;
  46. }
  47.  
Time limit exceeded #stdin #stdout 5s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty