Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
good triplet
#include <bits/stdc++.h> //#include<iostream> //#include <vector> using namespace std; int main() { int N; cout<<"Enter the Candies length: \n"; cin>>N;//int x; //vector<int>triplet(N); int triplet[N]; for(int i = 0; i < N; i++) //{ cin >> x; triplet.push_back(x); } { cin>>triplet[i]; } for(int i=0;i<N;i++){cout<<triplet[i]<<" ";}cout<<endl; int count=0,i,j,k; for( i = 0; i < N; i++) { for( j = 0; j < N; j++) { for( k = 0; k < N; k++) { if( triplet[i] > triplet[j] and triplet[j]>triplet[k] and i < j and j<k) { count=count+1; } } } } cout << count; return 0; }
run
|
edit
|
history
|
help
0
Bitwise - Check power of 2 or not
Set of intervals.
FInd rows with maximum no of 1's
use of assert to check a particular situation! (throws error)
Wave Sort
maximum_frequent_sum
Best time to buy and sell stocks
Test 12(2021)
顺序表的实现——动态分配
Varadic macro