#include "Alice.h"
#include <bits/stdc++.h>
#define ll long long
#define db double
#define imx INT_MAX
#define imn INT_MIN
#define lmx LLONG_MAX
#define lmn LLONG_MIN
#define ld long double
#define lid id * 2 + 1
#define rid id * 2 + 2
using namespace std;
vector<pair<int, int>> Alice(){
ll x = setN(4996);
int t = 11;
vector<pair<int, int>> v;
for (int i = 0; i < 9; i++) v.push_back(make_pair(i + 1, i + 2));
for (int i = 0; i < 18; i++) {
for (int j = 0; j < 277; j++) {
v.push_back(make_pair(x % 10 + 1, t));
t++;
}
x /= 10;
}
return v;
}
#include "Bob.h"
#include <bits/stdc++.h>
#define ll long long
#define db double
#define imx INT_MAX
#define imn INT_MIN
#define lmx LLONG_MAX
#define lmn LLONG_MIN
#define ld long double
#define lid id * 2 + 1
#define rid id * 2 + 2
using namespace std;
ll Bob(vector<pair<int, int>> v){
ll ans = 0, mult = 1, t = 11;
vector<int> cor(5000, -1);
for (int i = 0; i < v.size(); i++) cor[v[i].second] = v[i].first - 1;
for (int i = 0; i < 18; i++) {
bool added = false;
for (int j = 0; j < 277; j++) {
if (added or cor[t] == -1) {
t++;
continue;
}
ans += mult * cor[t];
added = true;
t++;
}
if (not added) for (;;) {}
mult *= 10;
}
return ans;
}
Compilation message
Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:17:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
17 | for (int i = 0; i < v.size(); i++) cor[v[i].second] = v[i].first - 1;
| ~~^~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
792 KB |
Correct. |
2 |
Execution timed out |
1090 ms |
960 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
792 KB |
Correct. |
2 |
Execution timed out |
1090 ms |
960 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
792 KB |
Correct. |
2 |
Execution timed out |
1090 ms |
960 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |