QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#176035 | #5681. Caravan Trip Plans | Fr1nGeLove | Compile Error | / | / | C++20 | 1.9kb | 2023-09-11 08:38:14 | 2023-09-11 08:38:15 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, m;
std::cin >> n >> m;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
while (m--) {
int idx, t;
std::cin >> idx >> t;
int camp = a[idx - 1];
int res = t - camp;
i64 ans = 0;
for (int v = 0; v <= res; v++) {
std::vector f(idx + 1, std::vector<i64>(v + 1));
f[0][0] = 1;
for (int i = 1; i <= idx; i++) {
for (int j = 0; j <= v; j++) {
for (int k = 0; k <= j; k++) {
f[i][j] += f[i - 1][k];
}
}
}
ans += f[idx][v];
}
std::cout << ans << "\n";
// std::cerr << "NO\n";
}
return 0;
}#include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, m;
std::cin >> n >> m;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
while (m--) {
int idx, t;
std::cin >> idx >> t;
int camp = a[idx - 1];
int res = t - camp;
i64 ans = 0;
for (int v = 0; v <= res; v++) {
std::vector f(idx + 1, std::vector<i64>(v + 1));
f[0][0] = 1;
for (int i = 1; i <= idx; i++) {
for (int j = 0; j <= v; j++) {
for (int k = 0; k <= j; k++) {
f[i][j] += f[i - 1][k];
}
}
}
ans += f[idx][v];
}
std::cout << ans << "\n";
// std::cerr << "NO\n";
}
return 0;
}
Details
answer.code:42:2: error: stray ‘#’ in program 42 | }#include <bits/stdc++.h> | ^ answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:12: error: ‘bits’ was not declared in this scope 42 | }#include <bits/stdc++.h> | ^~~~ answer.code:42:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 42 | }#include <bits/stdc++.h> | ^~~~ | std answer.code:42:3: error: ‘include’ does not name a type 42 | }#include <bits/stdc++.h> | ^~~~~~~ answer.code:46:5: error: redefinition of ‘int main()’ 46 | int main() { | ^~~~ answer.code:5:5: note: ‘int main()’ previously defined here 5 | int main() { | ^~~~