Task: | Counter |
Sender: | bubu2006 |
Submission time: | 2024-11-27 16:58:17 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.01 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
#14 | ACCEPTED | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.01 s | details |
#18 | ACCEPTED | 0.00 s | details |
#19 | ACCEPTED | 0.00 s | details |
#20 | WRONG ANSWER | 0.00 s | details |
#21 | WRONG ANSWER | 0.00 s | details |
#22 | ACCEPTED | 0.00 s | details |
#23 | ACCEPTED | 0.00 s | details |
#24 | ACCEPTED | 0.00 s | details |
#25 | ACCEPTED | 0.00 s | details |
#26 | ACCEPTED | 0.00 s | details |
#27 | ACCEPTED | 0.00 s | details |
Code
#pragma GCC optimize("O3,unroll-loops") #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef long double ld; string to_string(string s) { return '"' + s + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(bool b) { return (b ? "true" : "false"); } template <typename A, typename B> string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } template <typename A> string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); } res += "}"; return res; } void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #ifdef LOCAL #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) 42 #endif signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); // RTE if input wrong datatype int x; cin >> x; int up = (x + 10) / 11; int val = up * 11; if (val == x) { cout << up; return 0; } if ((val - x) & 1) { val += 11; up++; } int down = (val - x) / 2; int less = val; while (less > x) less -= 11; if (less - down * 2 < 0) { cout << -1; } else { cout << up + down; } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
0 |
correct output |
---|
0 |
user output |
---|
0 |
Test 2
Verdict: ACCEPTED
input |
---|
1 |
correct output |
---|
-1 |
user output |
---|
-1 |
Test 3
Verdict: ACCEPTED
input |
---|
2 |
correct output |
---|
-1 |
user output |
---|
-1 |
Test 4
Verdict: ACCEPTED
input |
---|
10 |
correct output |
---|
-1 |
user output |
---|
-1 |
Test 5
Verdict: ACCEPTED
input |
---|
11 |
correct output |
---|
1 |
user output |
---|
1 |
Test 6
Verdict: ACCEPTED
input |
---|
23 |
correct output |
---|
8 |
user output |
---|
8 |
Test 7
Verdict: ACCEPTED
input |
---|
90 |
correct output |
---|
20 |
user output |
---|
20 |
Test 8
Verdict: ACCEPTED
input |
---|
8 |
correct output |
---|
-1 |
user output |
---|
-1 |
Test 9
Verdict: ACCEPTED
input |
---|
88 |
correct output |
---|
8 |
user output |
---|
8 |
Test 10
Verdict: ACCEPTED
input |
---|
2 |
correct output |
---|
-1 |
user output |
---|
-1 |
Test 11
Verdict: ACCEPTED
input |
---|
62 |
correct output |
---|
8 |
user output |
---|
8 |
Test 12
Verdict: ACCEPTED
input |
---|
53 |
correct output |
---|
6 |
user output |
---|
6 |
Test 13
Verdict: ACCEPTED
input |
---|
55 |
correct output |
---|
5 |
user output |
---|
5 |
Test 14
Verdict: ACCEPTED
input |
---|
84 |
correct output |
---|
10 |
user output |
---|
10 |
Test 15
Verdict: ACCEPTED
input |
---|
72 |
correct output |
---|
16 |
user output |
---|
16 |
Test 16
Verdict: ACCEPTED
input |
---|
71 |
correct output |
---|
10 |
user output |
---|
10 |
Test 17
Verdict: ACCEPTED
input |
---|
16 |
correct output |
---|
5 |
user output |
---|
5 |
Test 18
Verdict: ACCEPTED
input |
---|
86 |
correct output |
---|
9 |
user output |
---|
9 |
Test 19
Verdict: ACCEPTED
input |
---|
81 |
correct output |
---|
18 |
user output |
---|
18 |
Test 20
Verdict: WRONG ANSWER
input |
---|
19 |
correct output |
---|
10 |
user output |
---|
-1 |
Test 21
Verdict: WRONG ANSWER
input |
---|
21 |
correct output |
---|
9 |
user output |
---|
-1 |
Test 22
Verdict: ACCEPTED
input |
---|
249 |
correct output |
---|
25 |
user output |
---|
25 |
Test 23
Verdict: ACCEPTED
input |
---|
835 |
correct output |
---|
83 |
user output |
---|
83 |
Test 24
Verdict: ACCEPTED
input |
---|
94 |
correct output |
---|
18 |
user output |
---|
18 |
Test 25
Verdict: ACCEPTED
input |
---|
10000 |
correct output |
---|
915 |
user output |
---|
915 |
Test 26
Verdict: ACCEPTED
input |
---|
100000 |
correct output |
---|
9098 |
user output |
---|
9098 |
Test 27
Verdict: ACCEPTED
input |
---|
1000000 |
correct output |
---|
90915 |
user output |
---|
90915 |