Submission #528008

#TimeUsernameProblemLanguageResultExecution timeMemory
528008amukkalirLet's Win the Election (JOI22_ho_t3)C++17
5 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define prn printf #define scn scanf signed main () { int n,k; scn("%d%d", &n, &k); int a[n]; for(int i=0; i<n; i++) { int x; scn("%d%d", &a[i],&x); } sort(a, a+n); ll ans = 0; for(int i=0; i<k; i++){ ans += a[i]; } prn("%lld", ans); }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:10:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scn("%d%d", &n, &k);
      |        ^
Main.cpp:14:12: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scn("%d%d", &a[i],&x);
      |            ^
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...