Last active
June 17, 2016 09:10
-
-
Save Anupam02/02712144c279337d617058c489ddf991 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| using namespace std; | |
| int main() { | |
| string name; | |
| bool performedGood = false; | |
| int n, lower , upper; | |
| cin>>n; | |
| while(n--) { | |
| cin>>name>>lower>>upper; | |
| if(!performedGood) | |
| if(lower >= 2400 && upper > lower) { | |
| performedGood = true; | |
| } | |
| } | |
| if(performedGood) cout<<"YES"<<endl; | |
| else cout<<"NO"<<endl; | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<set> | |
| using namespace std; | |
| int main() { | |
| int t,n; | |
| long long int A[30]; | |
| cin>>t; | |
| while(t--) { | |
| cin>>n; | |
| set<long long int> myset; | |
| for(int i=0; i<n; i++) cin>>A[i]; | |
| for(int i=0; i<n; i++) myset.insert(abs(A[i])); | |
| cout<<myset.size()<<endl; | |
| } | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| using namespace std; | |
| int main() { | |
| unsigned long int n,k,answer; | |
| cin>>n>>k; | |
| answer = ((n/k)+1)*k; | |
| cout<<answer<<endl; | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| using namespace std; | |
| int main() { | |
| int n,h,minWidthOfRoad; | |
| cin>>n>>h; | |
| minWidthOfRoad=n; | |
| int A[n]; | |
| for(int i=0; i<n; i++) cin>>A[i]; | |
| for(int i=0; i<n; i++) if(A[i]>h) minWidthOfRoad++; | |
| cout<<minWidthOfRoad<<endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment