QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#135761 | #6386. Dolls | Mohammed_Atalah# | 0 | 1ms | 3828kb | C++17 | 1.9kb | 2023-08-05 23:45:57 | 2024-07-04 01:17:58 |
Judging History
answer
/// Template path: /home/mohammed/.config/sublime-text-3/Packages/User
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
// typedef
typedef long long ll;
typedef long double ld;
typedef vector<int> vecint;
typedef vector<char> vecchar;
typedef vector<string> vecstr;
typedef vector<long long> vecll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// Marcos
#define endl ("\n")
#define int long long
#define mod 1000000007
#define pi (3.141592653589)
#define REP(i,a,b) for (int i = a; i < b; i++)
#define RREP(i,a,b) for (int i = a; i > b; i--)
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
// Functions
long long squared(long long x) {return (x * x) % mod;}
int factorial(int n) {long long res = 1; for (int i = 1; i <= n; i++) {res = ((res * i) % mod + mod) % mod ;} return res;}
long long power(long long x, long long p) {if (p == 0) {return 1;} if (p % 2 == 1) {return (power(x, p - 1) * x) % mod;} return squared(power(x, p / 2));}
// cout << fixed;
// cout << setprecision(4);
// ---------(^_^)--------- //
void main_solve() {
int n; cin >> n;
vector<int> v;
map<int, int> mp;
int result = 1;
for (int i = 0; i < n; i ++) {
int x; cin >> x;
if (!mp[x]) {
mp[x]++;
v.push_back(x);
sort(v.begin(), v.end());
for (int j = 1; j <= i ; j ++) {
if (v[j] - v[j - 1] >= 2) {
result++;
}
}
}
cout << result << " ";
}
cout << endl;
}
int32_t main() {
fast;
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
// Just another problem (-_-)
int t;
t = 1;
// cin >> t;
while (t--) {
main_solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3828kb
input:
190 57 94 24 27 110 44 72 82 55 7 9 43 22 86 95 84 125 16 75 28 46 10 14 131 112 132 33 53 103 139 118 126 137 13 140 77 25 23 47 116 68 150 81 97 165 58 88 63 42 89 123 11 113 83 124 130 80 35 143 155 153 48 8 136 104 101 90 37 21 99 142 34 64 115 109 26 92 144 61 51 114 49 148 96 60 30 54 134 141 ...
output:
1 2 4 7 11 16 22 29 37 46 56 66 77 89 101 114 128 143 159 175 192 209 227 246 266 286 307 329 352 376 401 426 452 478 504 531 558 584 610 637 665 694 723 753 784 815 847 880 913 946 980 1014 1048 1081 1113 1145 1177 1210 1244 1279 1315 1351 1386 1421 1456 1492 1528 1565 1602 1640 1678 1715 1752 1789...
result:
wrong answer 1st lines differ - expected: '1 2 3 4 5 6 7 8 9 10 11 11 12 ...7 77 77 77 77 77 77 77 77 77 77', found: '1 2 4 7 11 16 22 29 37 46 56 6... 3857 3857 3857 3857 3857 3857 '
Subtask #2:
score: 0
Wrong Answer
Test #22:
score: 0
Wrong Answer
time: 0ms
memory: 3488kb
input:
3922 1195 63679 1195 96797 63679 60311 456263 228361 96797 270167 60311 169529 60311 60311 456263 270167 169529 375829 169529 169529 270167 375829 60311 228361 1195 375829 96797 375829 375829 96797 375829 169529 456263 375829 1195 375829 456263 96797 169529 228361 63679 270167 212365 456263 270167 9...
output:
1 2 2 4 4 8 12 17 17 24 24 33 33 33 33 33 33 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 ...
result:
wrong answer 1st lines differ - expected: '1 2 2 3 3 4 5 6 6 7 7 8 8 8 8 ...0 10 10 10 10 10 10 10 10 10 10', found: '1 2 2 4 4 8 12 17 17 24 24 33 ... 55 55 55 55 55 55 55 55 55 55 '
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%