답안 #975891

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975891 2024-05-06T02:18:49 Z vjudge1 Trol (COCI19_trol) C++17
10 / 50
1000 ms 348 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int q; ll l[105], r[105];

int main(){
	cin >> q;
	int sum=0;
	for(int i=1; i<=q; i++){
		cin >> l[i] >> r[i];
		for(int j=l[i]; j<=r[i]; j++){
			if(l[i] % 9 != 0){
				sum += l[i] % 9;
			}
			else{
				sum += l[i] % 10;
				l[i] -= l[i] % 10;
				sum += l[i] % 9;
			}
			l[i]++;
		}
		cout << sum << endl;
		sum = 0;
	}
	
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Execution timed out 1029 ms 344 KB Time limit exceeded
5 Execution timed out 1046 ms 348 KB Time limit exceeded