CSES - Aalto Competitive Programming 2024 - wk3 - Mon - Results
Submission details
Task:Wario kart I
Sender:AleksandrPolitov
Submission time:2024-09-16 17:46:43 +0300
Language:C++ (C++20)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#2ACCEPTED0.00 sdetails
#3ACCEPTED0.00 sdetails
#4ACCEPTED0.00 sdetails
#5ACCEPTED0.00 sdetails
#6ACCEPTED0.00 sdetails
#7ACCEPTED0.00 sdetails
#8ACCEPTED0.00 sdetails
#9ACCEPTED0.00 sdetails
#10ACCEPTED0.00 sdetails
#11ACCEPTED0.00 sdetails
#12ACCEPTED0.00 sdetails
#13ACCEPTED0.00 sdetails
#14ACCEPTED0.00 sdetails
#15ACCEPTED0.00 sdetails
#16ACCEPTED0.00 sdetails
#17ACCEPTED0.00 sdetails
#18ACCEPTED0.00 sdetails
#19ACCEPTED0.00 sdetails
#20ACCEPTED0.00 sdetails
#21ACCEPTED0.00 sdetails
#22ACCEPTED0.00 sdetails
#23ACCEPTED0.00 sdetails
#24ACCEPTED0.00 sdetails
#25ACCEPTED0.00 sdetails
#26ACCEPTED0.00 sdetails
#27ACCEPTED0.00 sdetails
#28ACCEPTED0.00 sdetails
#29ACCEPTED0.00 sdetails
#30ACCEPTED0.00 sdetails
#31ACCEPTED0.00 sdetails
#32ACCEPTED0.00 sdetails
#33ACCEPTED0.00 sdetails
#34ACCEPTED0.00 sdetails
#35ACCEPTED0.00 sdetails
#36ACCEPTED0.00 sdetails
#37ACCEPTED0.00 sdetails
#38ACCEPTED0.00 sdetails
#39ACCEPTED0.00 sdetails
#40ACCEPTED0.00 sdetails
#41ACCEPTED0.00 sdetails
#42ACCEPTED0.00 sdetails
#43ACCEPTED0.00 sdetails
#44ACCEPTED0.00 sdetails
#45ACCEPTED0.00 sdetails
#46ACCEPTED0.00 sdetails
#47ACCEPTED0.00 sdetails
#48ACCEPTED0.00 sdetails
#49ACCEPTED0.00 sdetails
#50ACCEPTED0.00 sdetails
#51ACCEPTED0.00 sdetails
#52ACCEPTED0.00 sdetails
#53ACCEPTED0.00 sdetails
#54ACCEPTED0.00 sdetails
#55ACCEPTED0.00 sdetails
#56ACCEPTED0.00 sdetails
#57ACCEPTED0.00 sdetails
#58ACCEPTED0.00 sdetails
#59ACCEPTED0.00 sdetails
#600.05 sdetails
#610.04 sdetails
#62ACCEPTED0.03 sdetails
#63ACCEPTED0.03 sdetails
#640.07 sdetails
#65ACCEPTED0.01 sdetails
#660.07 sdetails
#67ACCEPTED0.01 sdetails
#68ACCEPTED0.04 sdetails
#69ACCEPTED0.01 sdetails

Code

#ifdef ONPC
    #define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>

#define char unsigned char
#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()
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back

#define LSOne(S) ((S) & -(S))

using namespace std;
// mt19937 rnd(239);
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

typedef long long C;
typedef complex<C> P;
#define X real()
#define Y imag()

template<class T>
istream& operator>> (istream& is, complex<T>& p) {
    T value;
    is >> value;
    p.real(value);
    is >> value;
    p.imag(value);
    return is;
}

typedef long long ll;
typedef long double ld;

using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;

int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }

#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ", "; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? ", " : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef DEBUG
#define dbg(x...) cerr << "\e[91m"<<__func__<<":"<<__LINE__<<" [" << #x << "] = ["; _print(x); cerr << "\e[39m" << endl;
#else
#define dbg(x...)
#endif

template<typename S, typename T = S> void chmin(S &s, T t) {s = s < t ? s : t;}
template<typename S, typename T = S> void chmax(S &s, T t) {s = s > t ? s : t;}

const int INF = 1e9; // 10^9 = 1B is < 2^31-1
const ll LLINF = 4e18; // 4*10^18 is < 2^63-1
const double EPS = 1e-9;
const ll MOD = 1e9+7;

const int N=2e5+10;
ll dp[N];

int solve() {
    int n, m, k; std::cin >> n >> m >> k;
    //vector<int> v(m);
    std::set<int> st;
    for (int i = 0; i < m; i++) {
        int nm; std::cin >> nm;
        st.insert(nm);
    }
    //for (int i = 0; i < n; i++) std::cin >> v[i];

    dp[0]=0;
    for (int i = 0; i < k; i++) {
        dp[i+1]=max(dp[i+1], dp[i]+1);
        if(st.count(dp[i]%n)) {
            dp[i+1]=max(dp[i+1], dp[i]+2);
        }
        continue;
        dp[i]=max(dp[i], dp[i-1]+1);
        if(st.count(dp[i]%n)) {
            dp[i]=max(dp[i], dp[i-1]+2);
        }
    }

    std::cout << (dp[k]*100)%(100*n) << std::endl;


    
    return 0;
}

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int TET = 1;
    //cin >> TET;
    for (int i = 1; i <= TET; i++) {
        #ifdef ONPC
            cout << "TEST CASE#" << i << endl;
        #endif
        
        if (solve()) {
            break;
        }

        #ifdef ONPC
            cout << "__________________________" << endl;
        #endif
    }
    #ifdef ONPC
        cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl;
    #endif
}

Test details

Test 1

Verdict: ACCEPTED

input
1 0 1 

correct output
0

user output
0

Test 2

Verdict: ACCEPTED

input
1 1 4 

correct output
0

user output
0

Test 3

Verdict: ACCEPTED

input
2 1 9 

correct output
0

user output
0

Test 4

Verdict: ACCEPTED

input
3 0 7 

correct output
100

user output
100

Test 5

Verdict: ACCEPTED

input
3 2 14 
0 2 

correct output
100

user output
100

Test 6

Verdict: ACCEPTED

input
3 2 9 
1 2 

correct output
100

user output
100

Test 7

Verdict: ACCEPTED

input
4 4 19 
0 1 2 3 

correct output
200

user output
200

Test 8

Verdict: ACCEPTED

input
4 1 18 

correct output
0

user output
0

Test 9

Verdict: ACCEPTED

input
4 4 9 
0 1 2 3 

correct output
200

user output
200

Test 10

Verdict: ACCEPTED

input
5 3 15 
2 3 4 

correct output
400

user output
400

Test 11

Verdict: ACCEPTED

input
5 2 25 
3 4 

correct output
100

user output
100

Test 12

Verdict: ACCEPTED

input
5 2 4 
0 4 

correct output
100

user output
100

Test 13

Verdict: ACCEPTED

input
5 3 1 
1 3 4 

correct output
100

user output
100

Test 14

Verdict: ACCEPTED

input
5 5 23 
0 1 2 3 4 

correct output
100

user output
100

Test 15

Verdict: ACCEPTED

input
5 1 1 

correct output
100

user output
100

Test 16

Verdict: ACCEPTED

input
5 5 24 
0 1 2 3 4 

correct output
300

user output
300

Test 17

Verdict: ACCEPTED

input
5 0 5 

correct output
0

user output
0

Test 18

Verdict: ACCEPTED

input
5 5 0 
0 1 2 3 4 

correct output
0

user output
0

Test 19

Verdict: ACCEPTED

input
5 0 9 

correct output
400

user output
400

Test 20

Verdict: ACCEPTED

input
10 6 30 
3 4 5 6 7 8 

correct output
200

user output
200

Test 21

Verdict: ACCEPTED

input
10 4 50 
0 1 7 9 

correct output
100

user output
100

Test 22

Verdict: ACCEPTED

input
10 4 9 
0 4 5 9 

correct output
200

user output
200

Test 23

Verdict: ACCEPTED

input
10 6 3 
1 2 4 5 7 8 

correct output
400

user output
400

Test 24

Verdict: ACCEPTED

input
10 10 45 
0 1 2 3 4 5 6 7 8 9 

correct output
0

user output
0

Test 25

Verdict: ACCEPTED

input
10 2 2 
2 8 

correct output
200

user output
200

Test 26

Verdict: ACCEPTED

input
10 9 48 
0 1 2 3 4 5 6 8 9 

correct output
600

user output
600

Test 27

Verdict: ACCEPTED

input
10 0 11 

correct output
100

user output
100

Test 28

Verdict: ACCEPTED

input
10 9 0 
0 2 3 4 5 6 7 8 9 

correct output
0

user output
0

Test 29

Verdict: ACCEPTED

input
10 0 18 

correct output
800

user output
800

Test 30

Verdict: ACCEPTED

input
100 55 297 
1 2 5 7 8 10 11 13 14 18 21 26...

correct output
6900

user output
6900

Test 31

Verdict: ACCEPTED

input
100 42 499 
0 2 3 8 9 12 14 18 19 20 22 23...

correct output
400

user output
400

Test 32

Verdict: ACCEPTED

input
100 44 92 
2 6 7 9 10 11 12 13 15 17 18 2...

correct output
3200

user output
3200

Test 33

Verdict: ACCEPTED

input
100 55 35 
1 2 4 5 9 12 14 15 20 21 22 24...

correct output
5400

user output
5400

Test 34

Verdict: ACCEPTED

input
100 97 451 
0 1 2 3 4 5 6 7 8 9 10 11 12 1...

correct output
8300

user output
8300

Test 35

Verdict: ACCEPTED

input
100 22 27 
8 18 20 24 29 35 36 39 44 48 5...

correct output
3200

user output
3200

Test 36

Verdict: ACCEPTED

input
100 90 474 
0 2 3 4 5 6 8 9 10 11 12 13 14...

correct output
1200

user output
1200

Test 37

Verdict: ACCEPTED

input
100 7 113 
30 31 43 45 72 77 97 

correct output
1900

user output
1900

Test 38

Verdict: ACCEPTED

input
100 88 5 
0 1 2 3 5 6 7 9 10 11 12 13 14...

correct output
900

user output
900

Test 39

Verdict: ACCEPTED

input
100 1 182 
50 

correct output
8400

user output
8400

Test 40

Verdict: ACCEPTED

input
200 110 593 
2 3 4 7 11 12 14 17 19 20 21 2...

correct output
14100

user output
14100

Test 41

Verdict: ACCEPTED

input
200 83 998 
0 3 5 6 7 11 14 16 17 18 19 20...

correct output
19600

user output
19600

Test 42

Verdict: ACCEPTED

input
200 87 185 
5 13 15 16 19 21 23 25 26 29 3...

correct output
6600

user output
6600

Test 43

Verdict: ACCEPTED

input
200 110 70 
3 4 5 8 10 12 13 14 15 17 18 2...

correct output
11000

user output
11000

Test 44

Verdict: ACCEPTED

input
200 194 901 
0 1 2 3 4 5 6 7 8 9 10 11 12 1...

correct output
16700

user output
16700

Test 45

Verdict: ACCEPTED

input
200 44 55 
2 16 17 18 22 23 31 37 40 41 4...

correct output
6800

user output
6800

Test 46

Verdict: ACCEPTED

input
200 179 948 
0 1 2 3 4 5 6 7 8 9 10 11 12 1...

correct output
17200

user output
17200

Test 47

Verdict: ACCEPTED

input
200 15 227 
3 14 17 52 53 61 63 83 87 91 1...

correct output
4400

user output
4400

Test 48

Verdict: ACCEPTED

input
200 175 11 
0 1 2 4 5 6 7 8 9 10 11 12 13 ...

correct output
2100

user output
2100

Test 49

Verdict: ACCEPTED

input
200 2 364 
99 100 

correct output
16600

user output
16600

Test 50

Verdict: ACCEPTED

input
1000 549 2964 
0 4 9 11 12 13 15 16 18 19 20 ...

correct output
60800

user output
60800

Test 51

Verdict: ACCEPTED

input
1000 417 4986 
0 2 4 8 9 11 12 13 15 18 19 21...

correct output
6600

user output
6600

Test 52

Verdict: ACCEPTED

input
1000 436 925 
0 1 2 4 5 8 9 10 13 16 18 25 2...

correct output
31700

user output
31700

Test 53

Verdict: ACCEPTED

input
1000 551 353 
0 2 4 6 9 12 13 18 20 21 22 23...

correct output
54500

user output
54500

Test 54

Verdict: ACCEPTED

input
1000 967 4504 
0 1 2 3 4 5 6 7 8 9 10 11 12 1...

correct output
83100

user output
83100

Test 55

Verdict: ACCEPTED

input
1000 222 275 
1 2 5 12 14 20 22 24 29 35 51 ...

correct output
33200

user output
33200

Test 56

Verdict: ACCEPTED

input
1000 893 4738 
0 2 3 4 5 7 8 10 11 12 13 14 1...

correct output
90500

user output
90500

Test 57

Verdict: ACCEPTED

input
1000 76 1136 
15 24 65 72 83 86 100 133 142 ...

correct output
22200

user output
22200

Test 58

Verdict: ACCEPTED

input
1000 874 55 
0 1 2 3 4 5 6 7 8 9 10 11 13 1...

correct output
10200

user output
10200

Test 59

Verdict: ACCEPTED

input
1000 10 1822 
7 13 133 142 218 316 495 499 5...

correct output
84100

user output
84100

Test 60

Verdict:

input
100000 54882 296454 
0 2 3 4 5 6 7 9 15 16 18 20 21...

correct output
5941200

user output
(empty)

Test 61

Verdict:

input
100000 41702 498646 
4 5 6 7 9 11 14 17 18 23 24 29...

correct output
755600

user output
(empty)

Test 62

Verdict: ACCEPTED

input
100000 43600 92551 
2 4 7 10 12 17 18 30 34 35 36 ...

correct output
3319100

user output
3319100

Test 63

Verdict: ACCEPTED

input
100000 55080 35366 
1 2 3 4 6 7 8 12 13 14 15 17 2...

correct output
5465700

user output
5465700

Test 64

Verdict:

input
100000 96704 450359 
0 1 2 3 4 5 6 8 9 10 11 12 13 ...

correct output
8642700

user output
(empty)

Test 65

Verdict: ACCEPTED

input
100000 22199 27593 
6 14 28 38 39 45 46 48 49 50 5...

correct output
3364900

user output
3364900

Test 66

Verdict:

input
100000 89287 473789 
0 1 2 3 4 5 6 7 8 9 10 12 13 1...

correct output
9652600

user output
(empty)

Test 67

Verdict: ACCEPTED

input
100000 7630 113681 
0 8 18 24 27 64 69 85 92 102 1...

correct output
2231400

user output
2231400

Test 68

Verdict: ACCEPTED

input
100000 87344 5557 
0 1 2 3 4 5 7 8 9 10 11 13 14 ...

correct output
1043700

user output
1043700

Test 69

Verdict: ACCEPTED

input
100000 1037 182250 
34 264 299 412 456 495 653 655...

correct output
8414700

user output
8414700