We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfd4417 commit 5e2f6a6Copy full SHA for 5e2f6a6
1822A - TubeTube Feed.cpp
@@ -0,0 +1,46 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define ll long long
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+int main()
10
+{
11
+ int q;
12
+ cin>>q;
13
+ while(q--)
14
+ {
15
+ int n,t;
16
+ cin>>n>>t;
17
+ int a[n];
18
+ int b[n];
19
+ for(int i=1; i<=n; i++)
20
21
+ cin>>a[i];
22
+ }
23
24
25
+ cin>>b[i];
26
27
+ int ent = 0;
28
+ int ans = -1;
29
+ int tt = 0;
30
31
32
+ int tim = tt + a[i];
33
+ if(tim<=t && b[i]>ent)
34
35
+ ans = i;
36
+ ent = b[i];
37
38
+ tt++;
39
40
+ if(ans!=-1)
41
+ cout<<ans<<endl;
42
+ else
43
+ cout<<"-1"<<endl;
44
45
+ return 0;
46
+}
0 commit comments