Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. /// Typedef
  6. typedef long long ll;
  7. typedef unsigned long ul;
  8. typedef unsigned long long ull;
  9. typedef vector<int> vi;
  10. typedef vector<vi> vvi;
  11. typedef vector<ll> vll;
  12. typedef pair<int,int> pii;
  13. typedef pair<ll,ll> pll;
  14. typedef vector< pii > vii;
  15.  
  16. #define pb push_back
  17. #define ppb pop_back
  18. #define MP make_pair
  19. #define ff first
  20. #define ss second
  21. #define sf scanf
  22. #define pf printf
  23. #define SQR(x) ((x)*(x))
  24. #define loop(i, y) for(int i=0; i<int(y); i++)
  25. #define FOR(i, x, y) for(int i=int(x); i<=int(y); i++)
  26. #define ROF(i, x, y) for(int i=int(x); i>=int(y); i--)
  27. #define ALL(c) c.begin(), c.end()
  28. #define SZ(c) int(c.size())
  29. #define CLR(x, y) memset(x, y, sizeof(x))
  30. #define READ(f) freopen(f, "r", stdin)
  31. #define WRITE(f) freopen(f, "w", stdout)
  32. #define FastIO ios_base::sync_with_stdio(false)
  33. #define tr(it, container) for(auto it = container.begin(); it != container.end(); it++)
  34. #define sci(x) scanf("%d", &x)
  35. #define scii(x, y) scanf("%d %d", &x, &y)
  36. #define sciii(x, y, z) scanf("%d %d %d", &x, &y, &z)
  37. #define scl(x) scanf("%lld", &x)
  38. #define scll(x, y) scanf("%lld %lld", &x, &y)
  39. #define sclll(x, y, z) scanf("%lld %lld %lld", &x, &y, &z)
  40. #define bitCheck(N,in) ((bool)(N&(1<<(in))))
  41. #define bitOff(N,in) (N&(~(1LL<<(in))))
  42. #define bitOn(N,in) (N|(1LL<<(in)))
  43. #define bitFlip(a,k) (a^(1LL<<(k)))
  44. #define unq(v) sort(all(v)), (v).erase(unique(all(v)),v.end())
  45. #define common(a,b) sort(all(a)), sort(all(b)), a.erase(set_intersection(all(a),all(b),a.begin()),a.end())
  46. #define uncommon(a,b) sort(all(a)), sort(all(b)), a.erase(set_symmetric_difference(all(a),all(b),a.begin()),a.end())
  47. #define dbg(x) cout<<#x<<" = "<<x<<endl;
  48.  
  49. int main()
  50. {
  51. int n, k=0;
  52. while(sci(n)==1){
  53. int arr[1002]={0}, mark[20002]={0}, flag=0;
  54. for(int i=1; i<=n; i++){
  55. sci(arr[i]);
  56. if(arr[i]<=arr[i-1]){
  57. flag=1;
  58. }
  59. }
  60.  
  61. if(flag==0){
  62. for(int i=1; i<=n; i++){
  63. for(int j=i; j<=n; j++){
  64. if(mark[arr[i]+arr[j]]!=0){
  65. flag=1;
  66. }
  67. mark[arr[i]+arr[j]]=1;
  68. }
  69. }
  70. }
  71. if(!flag){
  72. printf("Case #%d: It is a B2-Sequence.\n\n", ++k);
  73. }
  74. else printf("Case #%d: It is not a B2-Sequence.\n\n", ++k);
  75. }
  76. return 0;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement