initial commit
This commit is contained in:
parent
181721e495
commit
0e75028455
29
1850A To My Critics/1850A.cpp
Normal file
29
1850A To My Critics/1850A.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
|
||||
void solve()
|
||||
{
|
||||
int a,b,c;
|
||||
cin>>a>>b>>c;
|
||||
if(a+b>=10)
|
||||
cout<<"YES"<<endl;
|
||||
else if(b+c>=10)
|
||||
cout<<"YES"<<endl;
|
||||
else if(a+c>=10)
|
||||
cout<<"YES"<<endl;
|
||||
else
|
||||
cout<<"NO"<<endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
cin >> TC;
|
||||
cin.ignore();
|
||||
while (TC--) solve();
|
||||
}
|
44
1851B Parity Sort/1851B.cpp
Normal file
44
1851B Parity Sort/1851B.cpp
Normal file
@ -0,0 +1,44 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
|
||||
void solve()
|
||||
{
|
||||
int n;
|
||||
cin>>n;
|
||||
vector<int>v(n);
|
||||
for(int i=0; i<n; ++i) cin>>v[i];
|
||||
vector<int>v2;
|
||||
v2=v;
|
||||
sort(v2.begin(),v2.end());
|
||||
bool possible=1;
|
||||
for(int i=0; i<n; ++i)
|
||||
{
|
||||
if(v[i]%2==0 && v2[i]%2!=0)
|
||||
{
|
||||
possible=0;
|
||||
break;
|
||||
}
|
||||
else if (v[i]%2!=0 && v2[i]%2==0)
|
||||
{
|
||||
possible=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(possible)
|
||||
cout<<"YES"<<endl;
|
||||
else
|
||||
cout<<"NO"<<endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
cin >> TC;
|
||||
cin.ignore();
|
||||
while (TC--) solve();
|
||||
}
|
Loading…
Reference in New Issue
Block a user