Submission #1019213

#TimeUsernameProblemLanguageResultExecution timeMemory
1019213Marco_EscandonRoom Temperature (JOI24_ho_t1)C++11
35 / 100
1 ms400 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const string ny[2] = {"No", "Yes"}; int main() { ll n,k; cin>>n>>k; ll cad[n]; ll bs=0; for(int i=0; i<n; i++) { cin>>cad[i]; cad[i]=cad[i]%k; if(cad[i]<k-cad[i]) cad[i]+=k; } sort(cad,cad+n); cout<<(cad[n-1]-cad[0]+1)/2; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:9:8: warning: unused variable 'bs' [-Wunused-variable]
    9 |     ll bs=0;
      |        ^~
#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...