# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
986523 | activedeltorre | Mixture (BOI20_mixture) | C++14 | 0 ms | 440 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
using namespace std;
struct str
{
int index,a,b,c;
};
vector<str>vec;
int solve1()
{
for(auto j:vec)
{
// cout<<j.a<<" "<<j;
if(j.a==j.b && j.a==j.c)
{
return 1;
}
}
return 0;
}
int solve2()
{
int i,j,x1,x2,x3,x4;
for(i=0;i<vec.size();i++)
{
for(j=i+1;j<vec.size();j++)
{
x1=vec[i].b-vec[i].a;
x2=vec[i].c-vec[i].a;
x3=vec[j].b-vec[j].a;
x4=vec[j].c-vec[j].a;
if(x3*x1<0 && x4*x1==x3*x2)
{
return 1;
}
}
}
return 0;
}
int solve()
{
if(solve1()==1)
{
return 1;
}
if(solve2()==1)
{
return 2;
}
/* if(solve3()==1)
{
return 3;
}*/
return 0;
}
int main()
{
int n,i,j,k,cnt=0,a,b,c,a1,b1,c1;
cin>>a1>>b1>>c1;
cin>>n;
char tip;
for(i=1;i<=n;i++)
{
cin>>tip;
if(tip=='A')
{
cnt++;
cin>>a>>b>>c;
vec.push_back({cnt,a*b1*c1,b*a1*c1,c*b1*a1});
}
if(tip=='R')
{
cin>>a;
for(j=0;j<vec.size();j++)
{
if(vec[j].index==a)
{
vec.erase(vec.begin()+j);
break;
}
}
}
cout<<solve()<<'\n';
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |