Submission #1127659

#TimeUsernameProblemLanguageResultExecution timeMemory
1127659SunbaeRoom Temperature (JOI24_ho_t1)C++20
5 / 100
1 ms328 KiB
#include <bits/stdc++.h> using namespace std; const int N = 5e5 + 5; int a[N]; signed main(){ int n, t; scanf("%d %d", &n, &t); for(int i = 0; i<n; ++i) scanf("%d", a+i); map<int,int> mp; for(int i = 0; i<n; ++i) ++mp[a[i] % t]; if(mp.size() == 1){ puts("0"); return 0;} int mx = 0; for(pair<int,int> it: mp) mx = max(mx, it.second); printf("%d", mx); }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:6:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     int n, t; scanf("%d %d", &n, &t);
      |               ~~~~~^~~~~~~~~~~~~~~~~
Main.cpp:7:35: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     for(int i = 0; i<n; ++i) scanf("%d", a+i);
      |                              ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...