# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20445 | mistake (#35) | 채점 시스템 (OJUZ11_judge) | C++14 | 1000 ms | 2020 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <cstring>
#include <iostream>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <complex>
#define mp(a, b) make_pair((a), (b))
#define pb(a) push_back((a))
#define pf(a) push_font((a))
#define rb() pop_back()
#define rf() pop_front()
#define sz(a) ((int)a.size())
using namespace std;
typedef long long lld;
typedef pair<int, int> pii;
typedef pair<lld, lld> pll;
typedef pair<lld, int> pli;
typedef pair<int, lld> pil;
typedef vector<vector<int>> Matrix;
typedef vector<vector<int>> Adj;
typedef vector<int> Row;
typedef complex<double> Complex;
typedef vector<Complex> Vcomplex;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const lld LINF = 1e18;
const double FINF = 1e15;
const double EPS = 1e-9;
const double PI = 2.0 * acos(0.0);
int n;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
int P, T;
scanf("%d %d", &P, &T);
if (P == 0) {
int ans = 0;
while (T) {
++ans;
T /= 10;
}
printf("%d\n", ans - 1);
continue;
}
int ans = 0;
int t = 1;
while (t <= P) t *= 10;
while (true) {
bool ok = true;
for (int j = 1; j <= 9; ++j) {
if (t * j + P <= T) {
ok = false;
break;
}
}
if (ok) break;
t *= 10;
++ans;
}
printf("%d\n", ans);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |