fork download
  1. #include<bits/stdc++.h>
  2. #define ll long long int
  3. #define ull unsigned long long int
  4. #define pb push_back
  5. #define mp make_pair
  6. #define vi vector<int>
  7. #define vvi vector<vi>
  8. #define Max(a,b) ((a)>(b)?(a):(b))
  9. #define Min(a,b) ((a)<(b)?(a):(b))
  10. #define rep(i,a,b) for(ll i=a;i<b;i++)
  11. #define all(a) a.begin(),a.end()
  12. #define endl '\n'
  13. #define hell 1000000007
  14. using namespace std;
  15.  
  16. class ParenthesesDiv2Medium {
  17. public:
  18. vector <int> correct(string);
  19. };
  20.  
  21. vector <int> ParenthesesDiv2Medium::correct(string s) {
  22. vector<int>ans;
  23. int open=0;
  24. int close=0;
  25. int n=s.length();
  26. rep(i,0,n){
  27. if(open==close && s[i]==')'){
  28. ans.pb(i);
  29. open++;
  30. continue;
  31. }
  32. if(open==n/2 && s[i]=='('){
  33. ans.pb(i);
  34. continue;
  35. }
  36. if(s[i]=='(')open++;
  37. else close++;
  38. }
  39. return ans;
  40. }
  41.  
  42.  
  43. //Powered by [KawigiEdit] 2.0!
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