Submission #198073

#TimeUsernameProblemLanguageResultExecution timeMemory
198073ZwariowanyMarcinTrol (COCI19_trol)C++14
50 / 50
12 ms396 KiB
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define ss(x) (int) x.size() #define pb push_back #define LL long long #define ld double #define cat(x) cerr << #x << " = " << x << endl #define FOR(i, j, n) for(int i = j; i <= n; ++i) #define boost cin.tie(0), ios_base::sync_with_stdio(0); using namespace std; int T; LL a, b; int main() { scanf ("%d", &T); while (T--) { LL c = 0; scanf ("%lld%lld", &a, &b); for (int i = 0; i < 9; ++i) { LL l = a; while (l % 9 != i) l++; LL r = b; while (0 <= r && r % 9 != i) r--; int x = (i == 0 ? 9 : i); if (l <= r) c += 1LL * x * ((r - l) / 9 + 1); } printf ("%lld\n", c); } return 0; }

Compilation message (stderr)

trol.cpp: In function 'int main()':
trol.cpp:20:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf ("%d", &T);
  ~~~~~~^~~~~~~~~~
trol.cpp:23:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf ("%lld%lld", &a, &b);
   ~~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...