initial commit

This commit is contained in:
ShazidMahsrafi 2023-06-08 00:01:28 +06:00
parent 4aaa7db602
commit 351bfe3045
5 changed files with 126 additions and 17 deletions

View File

@ -0,0 +1,19 @@
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,num1=0,h;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>h;
if(h==1)
num1++;
}
cout<<n-(num1/2)<<endl;
}
}

View File

@ -0,0 +1,36 @@
#include<bits/stdc++.h>
using namespace std;
int main(){
int q;
cin>>q;
while(q--)
{
int n,t;
cin>>n>>t;
int a[n],b[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
cin>>b[i];
}
int ent=0;
int index=-1;
for(int i=0;i<n;i++)
{
if(a[i]<=t-i)
{
if(b[i]>ent)
{
ent=b[i];
index=i+1;
}
}
}
cout<<index<<endl;
}
return 0;
}

View File

@ -0,0 +1,34 @@
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
string s;
cin>>s;
int flag1=0,flag2=0,flag3=0;
if(s.length()>=5)
{
for(int i=0;i<s.length();i++)
{
if(s[i]>='A' && s[i]<='Z' && flag1==0)
{
flag1=1;
}
else if(s[i]>='a' && s[i]<='z' && flag2==0)
{
flag2=1;
}
else if(s[i]>='0' && s[i] <='9' && flag3==0)
{
flag3=1;
}
if(flag1==1 && flag2==1 && flag3==1)
break;
}
}
if(s.length()>4 && flag1==1 && flag2==1 && flag3==1)
cout<<"Correct";
else
cout<<"Too weak";
return 0;
}

View File

@ -0,0 +1,13 @@
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
while(k--)
{
if(n%10==0) n=n/10;
else n=n-1;
}
cout<<n;
}

View File

@ -10,23 +10,30 @@ Feel free to check these codes out.
## Index ## Index
| Problem | Question | Solution | | Problem ID| Problem Name | Question | Solution |
| --------------| -----------------------------------|-----------------------------------------------| | ----------| ---------------|----------------------|--------------------------------|
| 1A-Theater Square | [Question]() | [Solution]() | 1A | Theater Square | [Question](https://codeforces.com/contest/1/problem/A) | [Solution]()
| 4A-Watermelon | [Question]() | [Solution]() | 4A | Watermelon | [Question](https://codeforces.com/contest/4/problem/A) | [Solution]()
| 50A-DominoPiling | [Question]() | [Solution]() | 50A | Domino Piling | [Question](https://codeforces.com/contest/50/problem/A) | [Solution]()
| 71A-WayTooLongWords | [Question]() | [Solution]() | 71A | Way Too Long Words | [Question](https://codeforces.com/contest/71/problem/A) | [Solution]()
| 112A-PetyaAndStrings | [Question]() | [Solution]() | 112A | Petya And Strings | [Question](https://codeforces.com/contest/112/problem/A) | [Solution]()
| 158A-NextRound | [Question]() | [Solution]() | 158A | Next Round | [Question](https://codeforces.com/contest/158/problem/A) | [Solution]()
| 231A-Team | [Question]() | [Solution]() | 231A | Team | [Question](https://codeforces.com/contest/231/problem/A) | [Solution]()
| 236A-BoyOrGirl | [Question]() | [Solution]() | 236A | Boy Or Girl | [Question](https://codeforces.com/contest/236/problem/A) | [Solution]()
| 263A-BeautifulMatrix | [Question]() | [Solution]() | 263A | Beautiful Matrix | [Question](https://codeforces.com/contest/263/problem/A) | [Solution]()
| 281A-WordCapitalization | [Question]() | [Solution]() | 281A | Word Capitalization | [Question](https://codeforces.com/contest/281/problem/A) | [Solution]()
| 282A-Bit++ | [Question]() | [Solution]() | 282A | Bit++ | [Question](https://codeforces.com/contest/282/problem/A) | [Solution]()
| 339A-HelpfulMaths | [Question]() | [Solution]() | 411A | Password Check | [Question](https://codeforces.com/problemset/problem/411/A) | [Solution]()
| 617A-Elephant | [Question]() | [Solution]() | 339A | Helpful Maths | [Question](https://codeforces.com/contest/339/problem/A) | [Solution]()
| 791A-BearAndBigBrother | [Question]() | [Solution]() | 546A | Soldier and Bananas | [Question](https://codeforces.com/contest/546/problem/A) | [Solution] ()
| 1833C-VladBuildingBeautifulArray | [Question]() | [Solution]() | 617A | Elephant | [Question](https://codeforces.com/contest/617/problem/A) | [Solution]()
| 791A | Bear And Big Brother | [Question](https://codeforces.com/contest/791/problem/A) | [Solution]()
| 977A | Wrong Substraction | [Question](https://codeforces.com/problemset/problem/977/A) | [SOlution]()
| 1792A | Gaming Forces | [Question](https://codeforces.com/problemset/problem/1792/A) | [Solution]()
| 1822A | TubeTube Feed | [Question](https://codeforces.com/problemset/problem/1822/A) | [Solution]()
| 1829A | Love Story | [Question](https://codeforces.com/contest/1829/problem/A) | [Solution] ()
| 1829B | Blank Spaces | [Question](https://codeforces.com/contest/1829/problem/B) | [Solution]()
| 1833C | Vlad Building Beautiful Array | [Question](https://codeforces.com/contest/1833/problem/C) | [Solution]()
<br> <br>