제출 #216523

#제출 시각아이디문제언어결과실행 시간메모리
216523vonatlusTrol (COCI19_trol)C++14
30 / 50
1092 ms384 KiB
/// wa ^3^ #pragma GCC optimize("O3") #include<bits/stdc++.h> #define x first #define y second #define pb push_back #define sz(x) (int) x.size() using namespace std; using ll = long long; using pii = pair<int, int>; const int MOD = 1e9 + 7; const int INF32 = 1e9 + 1e2; template<typename T> istream &operator>>(istream &a, vector<T> &v) { for (auto& x : v) a >> x; return a; } void stndrtn() { #ifdef accepted freopen(".in", "r", stdin); #endif } const bool flag = 0; int f(ll x) { int sum = 0; for (; x; x /= 10ll) sum += x%10; if (sum > 9) sum = f(sum); return sum; } void maincode() { int q; cin >> q; for (ll l, r; q--;) { cin >> l >> r; int sum = 0; for (ll i = l; i <= r; ++i) sum += f(i); cout << sum << "\n"; } } int main() { ios_base::sync_with_stdio(0); cin.tie(nullptr), stndrtn(); int ts = 1; if (flag) cin >> ts; while (ts--) maincode(); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

trol.cpp: In function 'std::istream& operator>>(std::istream&, std::vector<_Tp>&)':
trol.cpp:22:1: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 for (auto& x : v) a >> x; return a; }
 ^~~
trol.cpp:22:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
 for (auto& x : v) a >> x; return a; }
                           ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...