Submission #1183158

#TimeUsernameProblemLanguageResultExecution timeMemory
1183158nevuorigMatching (CEOI11_mat)C++20
63 / 100
2095 ms5292 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll int #define ld long double #define str string #define pb push_back #define pf push_front #define pob pop_back() #define pof pop_front() #define in insert #define fi first #define se second #define size size() #define begin begin() #define end end() #define back back() #define front front() #define rend rend() #define rbegin rbegin() #define ret return #define ull unsigned long long #define all(a) a.begin , a.end #define gcd __gcd #define lcm(a , b) (a * b) / gcd(a , b) #define friopen freopen ("exercise.in", "r", stdin); freopen("exercise.out", "w", stdout); using namespace std; using namespace __gnu_pbds; typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> pbds; const ll mod = 1e9 + 7 , mod2 = 998244353 , N = 5e5 , inf = 1e18; const ld esp = 0.0000001 , Pi = 3.1415926535897932384626433832795; void kol_a() { ll n , m , i , j , lst , x; cin >> n >> m; vector<ll> ans; ll a[n + 12] = {} , b[m + 12] = {}; for (i = 1 ; i <= n ; i ++) cin >> a[i]; for (i = 1 ; i <= m ; i ++) { cin >> b[i]; if (i >= n) { lst = 0; for (j = 1 ; j <= n ; j ++) { x = b[i - n + a[j]]; if (x < lst) goto to; lst = x; } ans.pb(i - n + 1); to:; } } cout << ans.size << '\n'; for (auto x : ans) cout << x << " "; } main() { // friopen ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll _ = 1; // cin >> _; while(_ --) kol_a(); } /* */

Compilation message (stderr)

mat.cpp:45:61: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   45 | const ll mod = 1e9 + 7 , mod2 = 998244353 , N = 5e5 , inf = 1e18;
      |                                                             ^~~~
mat.cpp:76:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   76 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...