답안 #20548

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20548 2017-02-12T09:36:59 Z 후시기다네가후시기다네(#73, prion344) 채점 시스템 (OJUZ11_judge) C++
100 / 100
156 ms 2020 KB
#include<cstdio>
#include<iostream>
#include<string>

using namespace std;

int main(void)
{
	int n; cin >> n;
	char buff[100];
	string a, b;

	while (n--)
	{
		scanf("%s", buff);
		a = buff;
		scanf("%s", buff);
		b = buff;


		if (a.size() >= b.size())
		{
			cout << 0 << endl;
			continue;
		}
		
		int cnt = b.size() - a.size() - 1;

		for (int i = 0; i < cnt; i ++)
			a.insert(0, 1, '0');
		a.insert(0, 1, '1');

		if (a > b)
			cout << cnt << endl;
		else
			cout << cnt + 1 << endl;



	}
}

Compilation message

judge.cpp: In function 'int main()':
judge.cpp:15:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", buff);
                    ^
judge.cpp:17:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", buff);
                    ^
# 결과 실행 시간 메모리 Grader output
1 Correct 156 ms 2020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 156 ms 2020 KB Output is correct
2 Correct 126 ms 2020 KB Output is correct
3 Correct 123 ms 2020 KB Output is correct
4 Correct 129 ms 2020 KB Output is correct
5 Correct 129 ms 2020 KB Output is correct
6 Correct 103 ms 2020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 156 ms 2020 KB Output is correct
2 Correct 126 ms 2020 KB Output is correct
3 Correct 123 ms 2020 KB Output is correct
4 Correct 129 ms 2020 KB Output is correct
5 Correct 129 ms 2020 KB Output is correct
6 Correct 103 ms 2020 KB Output is correct
7 Correct 133 ms 2020 KB Output is correct
8 Correct 96 ms 2020 KB Output is correct
9 Correct 113 ms 2020 KB Output is correct
10 Correct 93 ms 2020 KB Output is correct
11 Correct 146 ms 2020 KB Output is correct