New Text Document

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include <iostream> #include <cstdio> #include <climits> #include <algorithm> #include <queue> #include <cstring> #include <cmath> #include

<vector> #include <stack> #include <set> #include <map> #include <deque> #include <string> #define SET(p) memset(p,-1,sizeof(p)) #define CLR(p) memset(p,0,sizeof(p)) #define LL long long int #define ULL unsigned long long int using namespace std; class SRMCards { public: int maxTurns(vector<int> x) { int l=x.size(); sort(x.begin(),x.end()); x.push_back(INT_MAX); int ans=0,i; for(i=0;i<l;i++) { ans++; if(x[i]==x[i+1]-1) { i++; } } return ans; } }; // Powered by FileEdit // Powered by TZTester 1.01 [25-Feb-2003] // Powered by CodeProcessor

You might also like