답안 #975356

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975356 2024-05-05T02:54:15 Z vjudge1 Trol (COCI19_trol) C++17
20 / 50
1000 ms 420 KB
#include <iostream>
using namespace std;
#define ll long long
int memo[1000];
int main() {
   int t;
   cin>>t;
   for(int i=0;i<t;i++){
       ll l,r,temp=0,cnt=0;
       cin>>l>>r;
       
       for(int j=l;j<=r;j++){
           if(j%9==0){
               temp+=9;
           }
           else{
               temp+=(j%9);
           }
       }
       cout<<temp<<"\n";
   }
}

Compilation message

trol.cpp: In function 'int main()':
trol.cpp:9:22: warning: unused variable 'cnt' [-Wunused-variable]
    9 |        ll l,r,temp=0,cnt=0;
      |                      ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Execution timed out 1093 ms 420 KB Time limit exceeded
5 Execution timed out 1045 ms 344 KB Time limit exceeded