Chnaged folder names
This commit is contained in:
parent
c5af3b3a99
commit
4aaa7db602
22
1829A Love Story/1829A.cpp
Normal file
22
1829A Love Story/1829A.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int i, t, count;
|
||||
cin >> t;
|
||||
while (t--)
|
||||
{
|
||||
string s,c= "codeforces";
|
||||
cin >> s;
|
||||
count = 0;
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
if (s[i] != c[i])
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
cout << count << endl;
|
||||
}
|
||||
}
|
28
1829B Blank Spaces/1829B.cpp
Normal file
28
1829B Blank Spaces/1829B.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int i, n, t, count, ans;
|
||||
cin >> t;
|
||||
while (t--)
|
||||
{
|
||||
cin >> n;
|
||||
int a[n];
|
||||
ans = 0;
|
||||
count = 0;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
cin >> a[i];
|
||||
if (a[i] == 0)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
ans= max(count,ans);
|
||||
count= 0;
|
||||
}
|
||||
}
|
||||
cout << max(count,ans) << endl;
|
||||
}
|
||||
}
|
15
546A Soldier and Bananas/546A.cpp
Normal file
15
546A Soldier and Bananas/546A.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int k,n,w;
|
||||
cin>>k>>n>>w;
|
||||
int i,money=0;
|
||||
for(i=1;i<=w;i++)
|
||||
{
|
||||
money=money+i*k;
|
||||
}
|
||||
if(money>n) cout<<money-n<<endl;
|
||||
else cout<<0<<endl;
|
||||
}
|
Loading…
Reference in New Issue
Block a user