QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#36215 | #4286. 99 Problems | cheems_is_hiring | WA | 2ms | 3712kb | C++ | 871b | 2022-06-26 00:05:49 | 2022-06-26 00:05:49 |
Judging History
answer
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
set<int> A;
for(int i = 1; i <= 10 ; i ++) {
for(int j = 1 ; j <= 4 ; j ++) {
A.insert( i * (pow(10,j)) -1);
}
}
int a; cin >> a;
int dis = 999999 , ans = -1;
for(int x : A ) {
if(x >= a)
if(abs(x - a) < dis) {
dis = abs(x - a);
ans = x;
}
}
cout << ans << endl;
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3712kb
input:
10
output:
19
result:
wrong answer 1st lines differ - expected: '99', found: '19'