| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1234531 | dtk245 | Trol (COCI19_trol) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a,b;
cin>>a>>b;
int hasil=0;
int has=0;
if(b-a>0){
cout<<(b*(b+1))/2<<endl;
}
else {
while(a>0){
hasil+=a%10;
a/=10;
}
while(hasil>0){
has+=hasil%10;
hasil/=10;
}
cout<<has<<endl;
}
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
