Sayandas 3108
Sayandas 3108
Assessment report
TOTAL SCORE
175/300 Top 6%
TEST
BENCHMARK
RANK* ATTEMPTED
13/207 3 of 3 questions
Jul 08 2024, 07:49:34 PM IST (Asia/Kolkata) Jul 08 2024, 09:49:34 PM IST (Asia/Kolkata) 1 hr 59 min 59 sec of 2 hr used.
Skill-wise performance
backtracking
math
Skills (4)
dynamic programming
algorithms
0 10 20 30 40 50 60 70 80 90 100
Score (%)
Skill score for the candidate Average score of a skill within the test
1 import java.io.BufferedReader;
2 import java.io.InputStreamReader;
3 import java.util.*;
4 class TestClass {
5 public static void main(String args[] ) throws Exception {
6 //BufferedReader
7 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8 int n = Integer.parseInt(br.readLine());
9
10 int dp[]=new int[n+1];
11 dp[0]=1;
12 dp[1]=1;
13
14 for(int i=2;i<=n;i++)
15 dp[i]+=dp[i-1]+dp[i-2];
16
17 System.out.println(dp[n]);
18 }
19 }
20
Score Result Time Time Complexity Beta Space Complexity Beta Memory Language Submitted on
Sco e esu t e e Co p e ty eta Space Co p e ty eta e o y a guage Sub tted o
75 BEST 0.56661 sec O(n) O(1) 94096 KB Java 17 Jul 08 2024, 08:24:25 PM IST (Asia/Kolkata)
1 import java.io.BufferedReader;
2 import java.io.InputStreamReader;
3 import java.util.*;
4 class TestClass {
5 public static void main(String args[] ) throws Exception {
6 //BufferedReader
7 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8 String name[] = br.readLine().split(" ");
9
10 int alph[]=new int[27],c=0;
11
12 for(char ca:name[1].toCharArray())
13 if(++alph[ca-'a']==1)
14 c++;
15
16 int head=0,tail=0;
17
18 List<Integer> l=new ArrayList<>();
19
20 while(tail<name[0].length())
21 {
22 int pos=name[0].charAt(tail)-'a';
23
24 if(alph[pos]==0)
25 c++;
26
27 alph[pos]--;
28
29 if(alph[pos]==0)
30 c--;
31
32 if((tail-head)==name[1].length())
33 {
34 pos=name[0].charAt(head)-'a';
35
36 if(alph[pos]==0)
37 c++;
38 alph[pos]++;
39
40 if(alph[pos]==0)
41 c--;
42 head++;
43 }
44
45 if((tail-head+1)==name[1].length() && c==0)
46 l.add(head);
47
48 tail++;
49 }
50
i l (l)
51 System.out.println(l);
52 }
53 }
54
Score Result Time Time Complexity Beta Space Complexity Beta Memory Language Submitted on
0 0.71928 sec Unavailable Unavailable 92132 KB Java 17 Jul 08 2024, 09:47:34 PM IST (Asia/Kolkata)
1 import java.io.BufferedReader;
2 import java.io.InputStreamReader;
3 import java.util.*;
4 class TestClass {
5 public static void main(String args[] ) throws Exception {
6 //BufferedReader
7 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8 long n = Long.parseLong(br.readLine());
9
10 long a=n,c=0l;
11
12 long ans=0l;
13
14 while(a!=0)
15 {
16 c++;
17 a=a/10;
18 }
19
20 for(int i=1;i<=c;i++)
21 ans= ans + (long)(4l*Math.pow(5,i-1));
22
23 long count=0l,temp=0l;
24 while(n!=0)
25 {
26 count++;
27
28 if(help2(n%10)==true)
29 temp=0l;
30
31 long val=help(n%10);
32 temp+= (long)(val*Math.pow(5,count-1));
33 System.out.println(temp);
34 n=n/10;
35 }
36
37 ans=ans-1;
38
39 System.out.println(ans);
40 }
41
42 public static long help(long val)
43 {
44 if(val<1l)
45 return 4l;
46 else if(val<6l)
47 return 3l;
48 else if(val<8l)
49 return 2l;
50 else if(val<9l)
51 return 1l;
52
53 return 0;
54 }
55
56 public static boolean help2(long val)
57 {
58 if(val==0 || val==1 || val==6 || val==8 || val==9)
59 return false;
60
61 return true;
62 }
63 }
64
* - This information is based on the data that is available untill Jul 08 2024, 10:05:03 PM IST (Asia/Kolkata). Your rank may be updated once all the candidates have successfully completed their tests.
Thank you for taking this test. All the best for further processes.
Note: This report is generated by HackerEarth. To know more, visit www.hackerearth.com