Submission #3832498


Source Code Expand

#include<cstdio>
#define pritnf printf
#define scnaf scanf
#define retrun return
#define sizoef sizeof
#define inl inline
#define br break
#define con continue
#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))
#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))
#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))
#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))
#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))
#define re register
#define stt struct
#define gt(gt_a) goto gt_a
#define infa (0x3f3f3f3f)
#define infb (0x7fffffff)
#define infd (0x7f)
#define abss(abss_x) ((abss_x)>(0)?(abss_x):(-1)*(abss_x))
#define maxx(maxx_a,maxx_b) ((maxx_a)>(maxx_b)?(maxx_a):(maxx_b))
#define minn(a,b) ((a)<(b)?(a):(b))
#define in(in_a) freopen("D:/""/in"in_a".in","r",stdin)
#define out(out_a) freopen("D:/""/out"out_a".out","w",stdout)
typedef long long ll;
typedef int itn,nti,tin,tni,nit;
using namespace std;
const nit maxa=104;
const nit maxb=1e2;
const nit maxc=14;
#include<algorithm>
#include<map>

map<tni,tni>m;
tni n,ls,x[maxa];

inl bool cpe(tni a,tni b);

tin main()
{
	scanf("%d",&n);
	//
	fora(i,1,n)
	{
		scanf("%d",&ls);
		//
		if(m[ls]==1)
		{
			con;
		}
		else
		{
			m[ls]=1;
			x[++x[0]]=ls;
		}
	}
	//
	sort(x+1,x+1+n,cpe);
	//
	pritnf("%d\n",x[2]);
	return 0;
}

inl bool cpe(tni a,tni b)
{
	return a>b;
}

Submission Info

Submission Time
Task B - 心配性な富豪、ファミリーレストランに行く。
User luogu_bot3
Language C++ (GCC 5.4.1)
Score 100
Code Size 1590 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘tin main()’:
./Main.cpp:41:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
                ^
./Main.cpp:45:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&ls);
                  ^

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 18
Set Name Test Cases
All random_1.txt, random_10.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt, sample_1.txt, sample_2.txt, sample_3.txt, small_1.txt, small_2.txt, small_3.txt, small_4.txt, small_5.txt
Case Name Status Exec Time Memory
random_1.txt AC 1 ms 256 KB
random_10.txt AC 1 ms 256 KB
random_2.txt AC 1 ms 256 KB
random_3.txt AC 1 ms 256 KB
random_4.txt AC 1 ms 256 KB
random_5.txt AC 1 ms 256 KB
random_6.txt AC 1 ms 256 KB
random_7.txt AC 1 ms 256 KB
random_8.txt AC 1 ms 256 KB
random_9.txt AC 1 ms 256 KB
sample_1.txt AC 1 ms 256 KB
sample_2.txt AC 1 ms 256 KB
sample_3.txt AC 1 ms 256 KB
small_1.txt AC 1 ms 256 KB
small_2.txt AC 1 ms 256 KB
small_3.txt AC 1 ms 256 KB
small_4.txt AC 1 ms 256 KB
small_5.txt AC 1 ms 256 KB