Submission #1165722


Source Code Expand

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<cmath>
#include<string>

#define ls (t<<1)
#define rs ((t<<1)+1)
#define mid ((l+r)>>1)
#define fi first
#define se second
#define mk make_pair
#define pb push_back

#define N 1005
#define M 128
#define seed 23333

using namespace std;
const int inf=(int)1e9;
int i,j,m,n,p,k,f[N][M],T,d,ans;
int main()
{
		scanf("%d",&T);
		for (;T--;)
		{
				scanf("%d%d",&n,&d);
				ans=0;
				for (i=6;i>=0;--i)
					if (((d&(1<<i))>0)^(n%2==0))
						ans+=n*(1<<i);
						else ans+=(n-1)*(1<<i);
				printf("%d\n",ans);
		}
}

Submission Info

Submission Time
Task C - Cookie Breeding Machine
User qiaoranliqu
Language C++14 (GCC 5.4.1)
Score 100
Code Size 701 Byte
Status AC
Exec Time 2 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:29:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&T);
                 ^
./Main.cpp:32:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&d);
                        ^

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 6
Set Name Test Cases
All 00_sample.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt
Case Name Status Exec Time Memory
00_sample.txt AC 1 ms 256 KB
random_00.txt AC 2 ms 256 KB
random_01.txt AC 2 ms 256 KB
random_02.txt AC 2 ms 256 KB
random_03.txt AC 2 ms 256 KB
random_04.txt AC 2 ms 256 KB