//\\__ hr1212 __//\\
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mi;
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define siii(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pi(a) printf("%d\n",a)
#define nl printf("\n");
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define f(i,a,b) for(i=a;i<b;i++)
#define rf(i,a,b) for(i=a;i>=b;i--)
#define clr(x,a) memset(x,a,sizeof(x))
#define MAX 1000100
#define MOD 1000000007
int n,m;
map<int,int> mm;
int main(){
int r,k,i,c=0,x=0,y=0,j,t,l,z,x1=0,y1=0;
ll ans=0;string p;
int a[1000],cnt=1;
while(si(n)!=EOF)
{
mm.clear();
c=0;
f(i,0,n)
si(a[i]);
for(i=0;i<n;++i)
for(j=i;j<n;++j)
{
if(mm.find(a[i]+a[j])!=mm.end())
{
c=1;
break;
}
mm[a[i]+a[j]]=1;
}
f(i,0,n-1)
if(a[i]>=a[i+1])
{
c=1;
break;
}
if(a[0]<1)
c=1;
if(!c)
printf("Case #%d: It is a B2-Sequence.",cnt++);
else printf("Case #%d: It is not a B2-Sequence.",cnt++);
nl;
nl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mi;
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define siii(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pi(a) printf("%d\n",a)
#define nl printf("\n");
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define f(i,a,b) for(i=a;i<b;i++)
#define rf(i,a,b) for(i=a;i>=b;i--)
#define clr(x,a) memset(x,a,sizeof(x))
#define MAX 1000100
#define MOD 1000000007
int n,m;
map<int,int> mm;
int main(){
int r,k,i,c=0,x=0,y=0,j,t,l,z,x1=0,y1=0;
ll ans=0;string p;
int a[1000],cnt=1;
while(si(n)!=EOF)
{
mm.clear();
c=0;
f(i,0,n)
si(a[i]);
for(i=0;i<n;++i)
for(j=i;j<n;++j)
{
if(mm.find(a[i]+a[j])!=mm.end())
{
c=1;
break;
}
mm[a[i]+a[j]]=1;
}
f(i,0,n-1)
if(a[i]>=a[i+1])
{
c=1;
break;
}
if(a[0]<1)
c=1;
if(!c)
printf("Case #%d: It is a B2-Sequence.",cnt++);
else printf("Case #%d: It is not a B2-Sequence.",cnt++);
nl;
nl;
}
return 0;
}
No comments:
Post a Comment