File tree Expand file tree Collapse file tree 4 files changed +116
-1
lines changed
Codeforces/After Placement Expand file tree Collapse file tree 4 files changed +116
-1
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ written by Pankaj Kumar.
3+ country:-INDIA
4+ */
5+ #include < bits/stdc++.h>
6+ using namespace std ;
7+ typedef long long ll;
8+
9+
10+ int solve (){
11+ int a,b;
12+ cin>>a>>b;
13+ b=b%2 ;
14+ if (b==0 && a%2 ==0 ){
15+ cout<<" YES" <<endl;
16+ }
17+ else if (b==1 && a%2 ==0 && a!=0 ){
18+ cout<<" YES" <<endl;
19+ }
20+ else {
21+ cout<<" NO" <<endl;
22+ }
23+
24+ return 0 ;
25+ }
26+ int main ()
27+ {
28+ int testCase=1 ;
29+ cin>>testCase;
30+ while (testCase--){
31+ solve ();
32+ }
33+ return 0 ;
34+ }
Original file line number Diff line number Diff line change 1+ /*
2+ written by Pankaj Kumar.
3+ country:-INDIA
4+ */
5+ #include < bits/stdc++.h>
6+ using namespace std ;
7+ typedef long long ll;
8+
9+
10+ int solve (){
11+ int n;
12+ cin>>n;
13+ string s;
14+ cin>>s;
15+ int temp=sqrt (n);
16+ if (temp*temp==n){
17+ string my_string = " " ;
18+ for (int i=1 ;i<=temp;i++){
19+ my_string+=" 1" ;
20+ }
21+ for (int i = 1 ; i <= temp-2 ; i++)
22+ {
23+ my_string += " 1" ;
24+ for (int j=1 ;j<=temp-2 ;j++){
25+ my_string+=" 0" ;
26+ }
27+ my_string += " 1" ;
28+ }
29+ for (int i = 1 ; i <= temp; i++)
30+ {
31+ my_string += " 1" ;
32+ }
33+ if (my_string==s){
34+ cout<<" Yes" <<endl;
35+ }
36+ else {
37+ cout<<" No" <<endl;
38+ }
39+ }
40+ else {
41+ cout<<" No" <<endl;
42+ }
43+ return 0 ;
44+ }
45+ int main ()
46+ {
47+ int testCase=1 ;
48+ cin>>testCase;
49+ while (testCase--){
50+ solve ();
51+ }
52+ return 0 ;
53+ }
Original file line number Diff line number Diff line change 1+ /*
2+ written by Pankaj Kumar.
3+ country:-INDIA
4+ */
5+ #include < bits/stdc++.h>
6+ using namespace std ;
7+ typedef long long ll;
8+
9+
10+ int solve (){
11+ int l,r;
12+ cin>>l>>r;
13+ int diff=r-l;
14+ double temp = (-1 + sqrt (1 + 8.0 * diff)) / 2.0 ;
15+ int ans=(int )temp;
16+
17+ cout<<ans+1 <<endl;
18+ return 0 ;
19+ }
20+ int main ()
21+ {
22+ int testCase=1 ;
23+ cin>>testCase;
24+ while (testCase--){
25+ solve ();
26+ }
27+ return 0 ;
28+ }
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ class Solution {
5858 else
5959 return i;
6060 }
61- return sz (chalk)- 1 ;
61+ return 0 ;
6262 }
6363};
6464
You can’t perform that action at this time.
0 commit comments