QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#55211#1752. Ballpark Estimateabdelrahman001#AC ✓3ms3724kbC++633b2022-10-12 18:42:362022-10-12 18:42:38

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-12 18:42:38]
  • Judged
  • Verdict: AC
  • Time: 3ms
  • Memory: 3724kb
  • [2022-10-12 18:42:36]
  • Submitted

answer

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 1e3 + 5;
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll n;
    cin >> n;
    if(n < 10)
		return cout << n, 0;
    string s = to_string(n);
    int x = s.size();
    ll num = 5, pw = 1;
    for(int i = 2;i < x;i++)
		pw *= 10;
	n += num * pw;
	pw = 1;
	while(n >= 10)
		n /= 10, pw *= 10;
	cout << n * pw; 
    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3560kb

input:

1

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3540kb

input:

533839461958894364

output:

500000000000000000

result:

ok single line: '500000000000000000'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3620kb

input:

253879280762610326

output:

300000000000000000

result:

ok single line: '300000000000000000'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

861411989833943880

output:

900000000000000000

result:

ok single line: '900000000000000000'

Test #5:

score: 0
Accepted
time: 2ms
memory: 3628kb

input:

5

output:

5

result:

ok single line: '5'

Test #6:

score: 0
Accepted
time: 2ms
memory: 3708kb

input:

9

output:

9

result:

ok single line: '9'

Test #7:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

11

output:

10

result:

ok single line: '10'

Test #8:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

15

output:

20

result:

ok single line: '20'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3644kb

input:

49

output:

50

result:

ok single line: '50'

Test #10:

score: 0
Accepted
time: 2ms
memory: 3500kb

input:

1497

output:

1000

result:

ok single line: '1000'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

6583

output:

7000

result:

ok single line: '7000'

Test #12:

score: 0
Accepted
time: 2ms
memory: 3628kb

input:

8967

output:

9000

result:

ok single line: '9000'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

9758

output:

10000

result:

ok single line: '10000'

Test #14:

score: 0
Accepted
time: 2ms
memory: 3632kb

input:

10772

output:

10000

result:

ok single line: '10000'

Test #15:

score: 0
Accepted
time: 2ms
memory: 3640kb

input:

11644

output:

10000

result:

ok single line: '10000'

Test #16:

score: 0
Accepted
time: 2ms
memory: 3724kb

input:

20851

output:

20000

result:

ok single line: '20000'

Test #17:

score: 0
Accepted
time: 2ms
memory: 3724kb

input:

21166

output:

20000

result:

ok single line: '20000'

Test #18:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

24183

output:

20000

result:

ok single line: '20000'

Test #19:

score: 0
Accepted
time: 2ms
memory: 3620kb

input:

28860

output:

30000

result:

ok single line: '30000'

Test #20:

score: 0
Accepted
time: 2ms
memory: 3612kb

input:

32184

output:

30000

result:

ok single line: '30000'

Test #21:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

32325

output:

30000

result:

ok single line: '30000'