initial commit
This commit is contained in:
parent
04eb5963bc
commit
f7090f7720
35
1512A Spy Detected!/1512A.cpp
Normal file
35
1512A Spy Detected!/1512A.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
void solve()
|
||||
{
|
||||
int n;
|
||||
cin>>n;
|
||||
int a[n];
|
||||
for(int i=0; i<n; ++i)
|
||||
{
|
||||
cin>>a[i];
|
||||
}
|
||||
for(int i=1; i<n-1; ++i)
|
||||
{
|
||||
if(a[i]!=a[i-1] && a[i]!=a[i+1])
|
||||
{
|
||||
cout<<i+1<<endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(a[0]!=a[n/2]) cout<<"1"<<endl;
|
||||
else cout<<n<<endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
cin >> TC;
|
||||
cin.ignore();
|
||||
while (TC--) solve();
|
||||
}
|
26
1692A Marathon/1692A.cpp
Normal file
26
1692A Marathon/1692A.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
void solve()
|
||||
{
|
||||
int a,x,count=0;
|
||||
cin>>a;
|
||||
for(int i=0; i<3; ++i)
|
||||
{
|
||||
cin>>x;
|
||||
if(x>a) count++;
|
||||
}
|
||||
cout<<count<<endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
cin >> TC;
|
||||
cin.ignore();
|
||||
while (TC--) solve();
|
||||
}
|
22
1719A Chip Game/1719A.cpp
Normal file
22
1719A Chip Game/1719A.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
void solve()
|
||||
{
|
||||
int n,m;
|
||||
cin>>n>>m;
|
||||
if((n+m)%2==0) cout<<"Tonya"<<endl;
|
||||
else cout<<"Burenka"<<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