제출 #1232774

#제출 시각아이디문제언어결과실행 시간메모리
1232774billylolwkwkTrol (COCI19_trol)C++20
50 / 50
0 ms328 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define dbg(x) cout<<#x<<" = "<<x<<endl ll q,l,r,a; signed main(){ ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); cin>>q;while(q--){ cin>>l>>r;a=(r-l+1)/9*45; // 'l' BERALIH FUNGSI MENJADI SISA MOD l =r-((r-l+1)%9); while(r>l){a+=r%9;if(r%9==0)a+=9;r--;} cout<<a<<'\n'; }return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...