# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
During contest I really get nervous and I lost my concentration and the two main reasons which I find for that are :-
1. Getting WA on solution I submit
2. Seeing the leaderboad with thousands of submission and I am not able to figure out the solution of that question
The following reasons lead to silly mistakes or mistakes which you generally don't do ( i.e. missing the constraints of question etc)
In the last contest #Codeforces round 694 Div 2 due to silly mistakes I got wrong answer on Problem A ( System test Failed ) and WA on Problem B.
Here are my solution with WA and AC :-
1. Problem A which failed system test ( https://mirror.codeforces.com/contest/1471/submission/103419176 )
2. Problem A which got AC ( https://mirror.codeforces.com/contest/1471/submission/103465431 )
This is one the most silly mistake that I did in the following condition ( if( P[i].first % x) ) is I use '2' in place of 'x' as , in hurry I considered the sample case with x=2 ( I don't know how can I do so ).
Comedy part is I just solved problem C too which I was not able to come up with solution during contest .
I want suggestions on How to tackle these problems of anxiety and be more focused and concentrated during contest ??
I am confused ,which path should I follow out of these :-
should I practise question based on algorithms like I should search for particular type of algorithm and do lots of question of it after learning the algorithm from :-https://mirror.codeforces.com/problemset or https://cp-algorithms.com/ .
should I practise question based on difficulty from :- https://www.a2oj.com/Ladders.html and learn algorithm which come on my way of solving question .
I loved the first way but the problem is there are lot of algorithms and in which sequence should I learn them I don't know .please help.
Here is the question :-https://mirror.codeforces.com/contest/1270/problem/B
what i understood from the question that we need to find subarrays such that the difference of maximum and minimun element is equal to N (total emenets of array ) ,if it is not possible print "NO" else print "YES" and in next line print 1 and 'ending index' but if we are given an array 'A' and it is statifying condition max(A)-max(B)>=N then according to question answer should be 'YES' 1 N(size of array)
which we even need to check for subarray ?that's all I understood from question please help me out in understanding correctly
here's my code:- ```
using namespace std;
int main() { int t; cin>>t; while(t--) { int n,f=0; cin>>n;
int A[n],i,j,min=0,max=0,l,r; for(i=0;i<n;++i) { cin>>A[i]; if(max<A[i]) { max=A[i]; //finding max } } min=A[0]; for(i=1;i<n;++i) { if(min>A[i]) { min=A[i]; //finding min } } if(max-min>=n) //checking condition max(A)-min(A)=n { for(i=0;i<n;++i) { if(A[i]==min) //checking at what index is min and max present { l=i+1; //adding 1 in index as index taken from 0 to n-1 } if(A[i]==max) { r=i+1; } } if(l<r) //checking which is greater and printing accordingly { cout<<"YES"<<endl; cout<<l<<" "<<r<<endl; } else { cout<<"YES"<<endl; cout<<r<<" "<<l<<endl; } } else { cout<<"NO"<<endl; } } return 0;
}```
Name |
---|