You are viewing a single comment's thread. Return to all comments →
using namespace std;
void solve() { vectorv; sets; mapmp; ll n,m,j,i,y,z,l,r,d,x,k; cin>>n>>k; ll a[n+1]; ll c=0; for(i=0;i>a[i]; if(a[i]>k)c++; } x=0; ll mx=-1,ans=0; for(i=0;ik) { ans+=(i-mx)*(n-i); mx=i; } } cout<
} int main() { fast; int T=1; cin>>T; while(T--)solve(); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Number List
You are viewing a single comment's thread. Return to all comments →
include
using namespace std;
define ll long long
define no cout<<"No"<
define yes cout<<"Yes"<
define mod 1000000007
define nt 10 define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)void solve() { vectorv; sets; mapmp; ll n,m,j,i,y,z,l,r,d,x,k; cin>>n>>k; ll a[n+1]; ll c=0; for(i=0;i>a[i]; if(a[i]>k)c++; } x=0; ll mx=-1,ans=0; for(i=0;ik) { ans+=(i-mx)*(n-i); mx=i; } } cout<
} int main() { fast; int T=1; cin>>T; while(T--)solve(); return 0; }