From 982a7478cbdd88f2c2b15ba96c2c355b9c09ef46 Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Thu, 8 Feb 2024 13:53:09 +0600 Subject: [PATCH] update code of 1927D --- .../1927D.cpp | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/Codes/1927 D - Find the Different Ones!/1927D.cpp b/Codes/1927 D - Find the Different Ones!/1927D.cpp index 6688383..02704b7 100644 --- a/Codes/1927 D - Find the Different Ones!/1927D.cpp +++ b/Codes/1927 D - Find the Different Ones!/1927D.cpp @@ -59,25 +59,14 @@ void solve() { int n; cin>>n; - vectorv(n),pre(n); + vectorv(n),next(n,-1); for(auto &i:v) cin>>i; - vector>ind(n); - pre[0]=0; - for(int i=1; i>q; while(q--) @@ -85,13 +74,8 @@ void solve() int l,r; cin>>l>>r; l--,r--; - int ans=pre[r]-pre[l]; - if(ans) - { - cout<