| Task: | Laskutoimitus |
| Sender: | Lieska |
| Submission time: | 2025-12-20 16:59:40 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 10 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| #3 | ACCEPTED | 10 |
| #4 | WRONG ANSWER | 0 |
| #5 | WRONG ANSWER | 0 |
| #6 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | 1, 2, 6 | details |
| #2 | WRONG ANSWER | 0.00 s | 1, 2, 6 | details |
| #3 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5, 6 | details |
| #4 | WRONG ANSWER | 0.00 s | 2, 6 | details |
| #5 | WRONG ANSWER | 0.00 s | 2, 6 | details |
| #6 | ACCEPTED | 0.00 s | 2, 3, 4, 5, 6 | details |
| #7 | WRONG ANSWER | 0.05 s | 6 | details |
| #8 | WRONG ANSWER | 0.05 s | 6 | details |
| #9 | ACCEPTED | 0.05 s | 3, 4, 5, 6 | details |
| #10 | WRONG ANSWER | 0.05 s | 4, 6 | details |
| #11 | WRONG ANSWER | 0.05 s | 4, 6 | details |
| #12 | WRONG ANSWER | 0.05 s | 5, 6 | details |
| #13 | WRONG ANSWER | 0.05 s | 5, 6 | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:117:19: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
117 | for (ll i=0; i<s.size(); ++i){
| ~^~~~~~~~~Code
//////// From bqi343
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python! //
// pairs
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;
#define mp make_pair
#define f first
#define s second
#define tcT template<class T
#define tcTU tcT, class U
// ^ lol this makes everything look weird but I'll try it
tcT> using V = vector<T>;
tcT, size_t SZ> using AR = array<T,SZ>;
using vi = V<int>;
using vb = V<bool>;
using vl = V<ll>;
using vd = V<db>;
using vs = V<str>;
using vpi = V<pi>;
using vpl = V<pl>;
using vpd = V<pd>;
// vectors
// oops size(x), rbegin(x), rend(x) need C++17
#define sz(x) int((x).size())
#define bg(x) begin(x)
#define all(x) bg(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define sor(x) sort(all(x))
#define rsz resize
#define ins insert
#define pb push_back
#define eb emplace_back
#define ft front()
#define bk back()
#define lb lower_bound
#define ub upper_bound
tcT> int lwb(V<T>& a, const T& b) { return int(lb(all(a),b)-bg(a)); }
tcT> int upb(V<T>& a, const T& b) { return int(ub(all(a),b)-bg(a)); }
// loops
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define rep(a) F0R(_,a)
#define each(a,x) for (auto& a: x)
const int MOD = (int)1e9+7; // 998244353;
const int MX = (int)2e5+5;
const ll BIG = 1e18; // not too close to LLONG_MAX
const db PI = acos((db)-1);
const int dx[4]{1,0,-1,0}, dy[4]{0,1,0,-1}; // for every grid problem!!
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
template<class T> using pqg = priority_queue<T,vector<T>,greater<T>>;
// bitwise ops
// also see https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
constexpr int pct(int x) { return __builtin_popcount(x); } // # of bits set
constexpr int bits(int x) { // assert(x >= 0); // make C++11 compatible until USACO updates ...
return x == 0 ? 0 : 31-__builtin_clz(x); } // floor(log2(x))
constexpr int p2(int x) { return 1<<x; }
constexpr int msk2(int x) { return p2(x)-1; }
ll cdiv(ll a, ll b) { return a/b+((a^b)>0&&a%b); } // divide a by b rounded up
ll fdiv(ll a, ll b) { return a/b-((a^b)<0&&a%b); } // divide a by b rounded down
tcT> bool ckmin(T& a, const T& b) {
return b < a ? a = b, 1 : 0; } // set a = min(a,b)
tcT> bool ckmax(T& a, const T& b) {
return a < b ? a = b, 1 : 0; } // set a = max(a,b)
tcTU> T fstTrue(T lo, T hi, U f) {
++hi; assert(lo <= hi); // assuming f is increasing
while (lo < hi) { // find first index such that f is true
T mid = lo+(hi-lo)/2;
f(mid) ? hi = mid : lo = mid+1;
}
return lo;
}
tcTU> T lstTrue(T lo, T hi, U f) {
--lo; assert(lo <= hi); // assuming f is decreasing
while (lo < hi) { // find first index such that f is true
T mid = lo+(hi-lo+1)/2;
f(mid) ? lo = mid : hi = mid-1;
}
return lo;
}
tcT> void remDup(vector<T>& v) { // sort and remove duplicates
sort(all(v)); v.erase(unique(all(v)),end(v)); }
tcTU> void erase(T& t, const U& u) { // don't erase
auto it = t.find(u); assert(it != end(t));
t.erase(it); } // element that doesn't exist from (multi)set
ll M = 1000000007;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
// For the third subtask;
ll total = 0;
ll curr = 0;
for (ll i=0; i<s.size(); ++i){
curr = (curr*10)%M;
curr = (curr+((ll)s[i]-48)*(i+1))%M;
total = (total+curr)%M;
//cout << i << " " << curr << " " << total << "\n";
}
cout << total << "\n";
}
Test details
Test 1
Group: 1, 2, 6
Verdict: WRONG ANSWER
| input |
|---|
| *3*7*5+67*2*7*12+38*4+9+2+1+45... |
| correct output |
|---|
| 665527462 |
| user output |
|---|
| -26758633 |
Feedback: Incorrect character on line 1 col 1: expected "665527462", got "-26758633"
Test 2
Group: 1, 2, 6
Verdict: WRONG ANSWER
| input |
|---|
| 84149523195388144+1*8*5*1722+5... |
| correct output |
|---|
| 572374284 |
| user output |
|---|
| 559739540 |
Feedback: Incorrect character on line 1 col 2: expected "572374284", got "559739540"
Test 3
Group: 1, 2, 3, 4, 5, 6
Verdict: ACCEPTED
| input |
|---|
| 347358248955243114242997746491... |
| correct output |
|---|
| 823495931 |
| user output |
|---|
| 823495931 |
Test 4
Group: 2, 6
Verdict: WRONG ANSWER
| input |
|---|
| +4976829*6+5+9*21+4*889+6*7+4*... |
| correct output |
|---|
| 503712700 |
| user output |
|---|
| -884310109 |
Feedback: Incorrect character on line 1 col 1: expected "503712700", got "-884310109"
Test 5
Group: 2, 6
Verdict: WRONG ANSWER
| input |
|---|
| 862+83782+493135426+3152859674... |
| correct output |
|---|
| 624304680 |
| user output |
|---|
| 944860712 |
Feedback: Incorrect character on line 1 col 1: expected "624304680", got "944860712"
Test 6
Group: 2, 3, 4, 5, 6
Verdict: ACCEPTED
| input |
|---|
| 297736662651354417265929591745... |
| correct output |
|---|
| 625284593 |
| user output |
|---|
| 625284593 |
Test 7
Group: 6
Verdict: WRONG ANSWER
| input |
|---|
| +9+1+8+92*761+68*983*1+7*1+1*2... |
| correct output |
|---|
| 947469815 |
| user output |
|---|
| 241114942 |
Feedback: Incorrect character on line 1 col 1: expected "947469815", got "241114942"
Test 8
Group: 6
Verdict: WRONG ANSWER
| input |
|---|
| 97831833*7+4229897789494398634... |
| correct output |
|---|
| 173934151 |
| user output |
|---|
| 523279361 |
Feedback: Incorrect character on line 1 col 1: expected "173934151", got "523279361"
Test 9
Group: 3, 4, 5, 6
Verdict: ACCEPTED
| input |
|---|
| 777551563653223263644973172313... |
| correct output |
|---|
| 278364064 |
| user output |
|---|
| 278364064 |
Test 10
Group: 4, 6
Verdict: WRONG ANSWER
| input |
|---|
| +481+4+66+2+26+7+5+97+6+4+3+14... |
| correct output |
|---|
| 244847224 |
| user output |
|---|
| 357021157 |
Feedback: Incorrect character on line 1 col 1: expected "244847224", got "357021157"
Test 11
Group: 4, 6
Verdict: WRONG ANSWER
| input |
|---|
| +8858717+53+6927+314+742552843... |
| correct output |
|---|
| 928369840 |
| user output |
|---|
| 287578221 |
Feedback: Incorrect character on line 1 col 1: expected "928369840", got "287578221"
Test 12
Group: 5, 6
Verdict: WRONG ANSWER
| input |
|---|
| *7*75*59*7*9*74*4*18211*31*1*7... |
| correct output |
|---|
| 219382651 |
| user output |
|---|
| 360149878 |
Feedback: Incorrect character on line 1 col 1: expected "219382651", got "360149878"
Test 13
Group: 5, 6
Verdict: WRONG ANSWER
| input |
|---|
| 73171*3438*9*34165158853*375*7... |
| correct output |
|---|
| 451362612 |
| user output |
|---|
| 782242479 |
Feedback: Incorrect character on line 1 col 1: expected "451362612", got "782242479"
