We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int main()
{
int n, k, t=0;
scanf("%d %d", &n, &k);
int p=n;
while (p>1)
{
p=p-1;
t+=p;
}int m =0,am=0,om=0,xm=0;
int a[t],o[t],x[t];
for (int i=1;i<=n-1;i++)
{
for (int j=i+1;j<=n;j++)
{
a[m]=i&j;
if(a[m]
}
}
printf("%d\n%d\n%d\n",am,om,xm);
}
my code is giving me correct answer for all answer but it is give error for test 10 and test 12 botj are hidden test bu when i am trying to test run myself it is giving correct answer
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Bitwise Operators
You are viewing a single comment's thread. Return to all comments →
include
include
include
include
int main() { int n, k, t=0; scanf("%d %d", &n, &k); int p=n; while (p>1) { p=p-1; t+=p; }int m =0,am=0,om=0,xm=0; int a[t],o[t],x[t]; for (int i=1;i<=n-1;i++) { for (int j=i+1;j<=n;j++) { a[m]=i&j; if(a[m]
} my code is giving me correct answer for all answer but it is give error for test 10 and test 12 botj are hidden test bu when i am trying to test run myself it is giving correct answer