# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975208 | 2024-05-04T14:51:11 Z | vjudge1 | Trol (COCI19_trol) | C++17 | 1 ms | 508 KB |
// أَعُوذُ بِاللَّهِ مِنَ الشَّيْطَانِ الرَّجِيمِ #include <bits/stdc++.h> #define bismillah ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long using namespace std; int kecilkan(int a, int b){ b += a%10; a/=10; if(a>0){ kecilkan(a, b); }else if(b > 9){ kecilkan(b, 0); }else{ return b; } } int main(){ bismillah int q; cin >> q; int hasil; while(q--){ int l, r; cin >> l >> r; if(l > 9){ l = kecilkan(l, 0); } if(r > 9){ r = kecilkan(r, 0); } hasil = 0; for(int i = l; i <= r; i++){ hasil += i; } cout << hasil << endl; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
3 | Runtime error | 1 ms | 508 KB | Execution killed with signal 11 |
4 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
5 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |