Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:为啥用的哈希过不了?求大神解答!(代码附上)

Posted by bxdd at 2016-11-14 16:34:16 on Problem 3320
In Reply To:为啥用的哈希过不了?求大神解答!(代码附上) Posted by:201530122007 at 2016-07-17 20:44:55
> //别告诉我数组开小了?!
> #include<iostream>
> #include<stdio.h>
> #include<string.h>
> #define SIZE 10000000
> using namespace std;
> bool Hash[SIZE];
> int main()
> {
>     long long n;
>     while(cin>>n)
>     {
>     long long sol=0;
>     memset(Hash,0,sizeof(Hash));
>     while(n--)
>     {
>         long long a;
>         scanf("%lld",&a);
>         if(Hash[a])continue;
>         else Hash[a]=1;
>         sol++;
>     }
>     cout<<sol<<endl;
>     }
>     return 0;
> }

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator