Task: | Käännöt |
Sender: | hltk |
Submission time: | 2019-05-16 18:11:20 +0300 |
Language: | C++ |
Status: | READY |
Result: | 15 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 15 |
#2 | TIME LIMIT EXCEEDED | 0 |
#3 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.03 s | 1 | details |
#2 | ACCEPTED | 0.03 s | 1 | details |
#3 | ACCEPTED | 0.03 s | 1 | details |
#4 | ACCEPTED | 0.03 s | 1 | details |
#5 | ACCEPTED | 0.03 s | 1 | details |
#6 | TIME LIMIT EXCEEDED | -- | 2 | details |
#7 | TIME LIMIT EXCEEDED | -- | 2 | details |
#8 | TIME LIMIT EXCEEDED | -- | 2 | details |
#9 | TIME LIMIT EXCEEDED | -- | 2 | details |
#10 | TIME LIMIT EXCEEDED | -- | 2 | details |
#11 | TIME LIMIT EXCEEDED | -- | 3 | details |
#12 | TIME LIMIT EXCEEDED | -- | 3 | details |
#13 | TIME LIMIT EXCEEDED | -- | 3 | details |
#14 | TIME LIMIT EXCEEDED | -- | 3 | details |
#15 | TIME LIMIT EXCEEDED | -- | 3 | details |
Compiler report
input/code.cpp:1:0: warning: ignoring #pragma GCC optmize [-Wunknown-pragmas] #pragma GCC optmize("O3") input/code.cpp: In function 'int main()': input/code.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%s", c + 1); ~~~~~^~~~~~~~~~~~~
Code
#pragma GCC optmize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; #define M 1000000007 char c[123456]; long z[123456]; int main() { scanf("%s", c + 1); long n = strlen(c + 1); reverse(c + 1, c + n + 1); for (int i = 1; i <= n; ++i) { c[i] -= '0'; } z[0] = 1; for (int i = 1; i <= 100000; ++i) { z[i] = (z[i - 1] * 10) % M; } long r = 0; for (int i = 1; i <= n; ++i) { for (int j = i; j <= n; ++j) { reverse(c + i, c + j + 1); long y = 0; for (int it = 1; it <= n; ++it) { y += z[it-1] * c[it]; y %= M; } reverse(c + i, c + j + 1); r += y; r %= M; } } printf("%ld\n", r); }
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
825864589849478186996872119675... |
correct output |
---|
457966376 |
user output |
---|
457966376 |
Test 2
Group: 1
Verdict: ACCEPTED
input |
---|
191658935877461356157657491987... |
correct output |
---|
176954270 |
user output |
---|
176954270 |
Test 3
Group: 1
Verdict: ACCEPTED
input |
---|
348988594526165698179722696175... |
correct output |
---|
338693404 |
user output |
---|
338693404 |
Test 4
Group: 1
Verdict: ACCEPTED
input |
---|
959161872742625799336943933597... |
correct output |
---|
585928712 |
user output |
---|
585928712 |
Test 5
Group: 1
Verdict: ACCEPTED
input |
---|
925429363246698689162197257943... |
correct output |
---|
517617697 |
user output |
---|
517617697 |
Test 6
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
972591294933975999938266397628... |
correct output |
---|
667001154 |
user output |
---|
(empty) |
Test 7
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
275688881195265674233697529772... |
correct output |
---|
213272855 |
user output |
---|
(empty) |
Test 8
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
654678934762543351831648468742... |
correct output |
---|
465477034 |
user output |
---|
(empty) |
Test 9
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
852895263384279396767531876338... |
correct output |
---|
225052500 |
user output |
---|
(empty) |
Test 10
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
257723665884149498894428498943... |
correct output |
---|
169577498 |
user output |
---|
(empty) |
Test 11
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
965391619923528543348143963721... |
correct output |
---|
458795777 |
user output |
---|
(empty) |
Test 12
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
934996116481518541954869782274... |
correct output |
---|
38884659 |
user output |
---|
(empty) |
Test 13
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
356521595763548549682719476371... |
correct output |
---|
335143519 |
user output |
---|
(empty) |
Test 14
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
691571977153731228387836644955... |
correct output |
---|
504860195 |
user output |
---|
(empty) |
Test 15
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
882254176987218851832315176774... |
correct output |
---|
32749477 |
user output |
---|
(empty) |