Submission #527058

#TimeUsernameProblemLanguageResultExecution timeMemory
527058LucaDantasStreet Lamps (APIO19_street_lamps)C++17
0 / 100
1 ms296 KiB
// só pra não zerar, não aguento mais pensar depois do sofrimento do p2 #include <bits/stdc++.h> using namespace std; set<pair<int,int>> mark; int main() { int n, A, B; scanf("%d %d %d", &n, &A, &B); for(int i = 0; i < n; i++) { int l, r; scanf("%d %d", &l, &r); for(int t = l; t <= r; t++) mark.insert({(t + t/B) % A, t % B}); } printf("%ld\n", mark.size()); }

Compilation message (stderr)

street_lamps.cpp: In function 'int main()':
street_lamps.cpp:8:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  int n, A, B; scanf("%d %d %d", &n, &A, &B);
      |               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
street_lamps.cpp:10:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |   int l, r; scanf("%d %d", &l, &r);
      |             ~~~~~^~~~~~~~~~~~~~~~~
#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...