This commit is contained in:
Zengtudor 2024-08-06 10:42:14 +08:00
parent 2c879c469f
commit a9704560e3
2 changed files with 7 additions and 1 deletions

1
.gitignore vendored
View File

@ -44,3 +44,4 @@ day2/U111091/out.txt
day2/U111091/fixed
day4/T435167/T435167
day4/U461920/U461920
test.txt

View File

@ -6,9 +6,11 @@ using namespace std;
#ifdef DEBUG
#define PRINT_VALUE(v){cout<<#v<<" :"<<v<<endl;}
#define PRINT_ARRAY(arr,size){cout<<#arr<<" [";for(int i=1;i<=size;i++)cout<<arr[i]<<(i!=size?",":"]\n");}
#endif
#ifndef DEBUG
#define PRINT_VALUE(v)
#define PRINT_ARRAY(arr,size)
#endif
const int MAX_N=5*1e5+5;
@ -25,12 +27,15 @@ void set_num_times_mem(){
int main(){
cin>>n;
set_num_times_mem();
PRINT_ARRAY(num_times,n);
for(int i=1;i<=n;i++){
cin>>arr[i];
num_times[arr[i]]++;
PRINT_VALUE(i);
PRINT_VALUE(arr[i])
PRINT_VALUE(arr[i]);
PRINT_VALUE(num_times[arr[i]]);
PRINT_ARRAY(arr, n);
PRINT_ARRAY(num_times,n);
if (i==1) {
ans=max(num_times[arr[i]],ans);
}else{