# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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 |
---|