답안 #20661

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20661 2017-02-13T10:54:47 Z 우리OJ(#80, cki86201) 채점 시스템 (OJUZ11_judge) C++14
100 / 100
46 ms 2020 KB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef pair<int, int> Pi;
typedef long long ll;
#define pii Pi
#define pll PL
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> PL;

void solve(){
	int n, m;
	scanf("%d%d", &n, &m);
	ll L = 1;
	while(L <= n)L *= 10;
	if(n == 0)L = 10;
	int ans = 0;
	while(1){
		if(n + L <= m)ans++, L *= 10;
		else break;
	}
	printf("%d\n", ans);
}

int main(){
	int Tc = 1; scanf("%d", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		//printf("Case #%d: ", tc);
		solve();
	}
	return 0;
}

Compilation message

judge.cpp: In function 'void solve()':
judge.cpp:35:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &n, &m);
                       ^
judge.cpp: In function 'int main()':
judge.cpp:48:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int Tc = 1; scanf("%d", &Tc);
                              ^
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 2020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 2020 KB Output is correct
2 Correct 39 ms 2020 KB Output is correct
3 Correct 46 ms 2020 KB Output is correct
4 Correct 39 ms 2020 KB Output is correct
5 Correct 39 ms 2020 KB Output is correct
6 Correct 43 ms 2020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 2020 KB Output is correct
2 Correct 39 ms 2020 KB Output is correct
3 Correct 46 ms 2020 KB Output is correct
4 Correct 39 ms 2020 KB Output is correct
5 Correct 39 ms 2020 KB Output is correct
6 Correct 43 ms 2020 KB Output is correct
7 Correct 36 ms 2020 KB Output is correct
8 Correct 39 ms 2020 KB Output is correct
9 Correct 39 ms 2020 KB Output is correct
10 Correct 39 ms 2020 KB Output is correct
11 Correct 29 ms 2020 KB Output is correct