Submission #496391

#TimeUsernameProblemLanguageResultExecution timeMemory
496391MukhitaliMeteors (POI11_met)C++17
61 / 100
6051 ms3404 KiB
//bit chass 1 #pragma GCC optimize ("Ofast") #pragma GCC optimize ("unroll-loops") #pragma GCC ("avx,avx2,fma") #include <bits/stdc++.h> #define x first #define y second #define el "\n" #define ll long long #define pb push_back #define pll pair <ll, ll> #define pii pair <int, int> #define all(x) x.begin(), x.end() #define lcm(x,y) x * y / __gcd(x, y) #define ibase ios_base::sync_with_stdio(0), cin.tie(0) using namespace std; const int N = 3e5 + 5, inf = 1e9 + 7, M = 2e6, MM = 2e6 + 5, K = 300; const ll MI = 2e18; const double P = 3.14; ll o[N], p[N], an[N]; void solve() { int n, m; cin >> n >> m; for (int i = 1; i <= m; i++) cin >> o[i]; for (int i = 1; i <= n; i++) { cin >> p[i]; } int k; cin >> k; for (int i = 1; i <= k; i++) { int l, r, a; cin >> l >> r >> a; while (true) { if (l == m + 1) l = 1; if (p[o[l]] > 0 && p[o[l]] <= a) an[o[l]] = i; p[o[l]] -= a; if (l == r) break; l++; } } for (int i = 1; i <= n; i++) { if (an[i]) cout << an[i] << el; else cout << "NIE" << el; } } int main() { ibase; int T = 1; // cin >> T; for (int i = 1; i <= T; i++) { // cout << "Case " << i << ": "; solve(); cout << el; } }

Compilation message (stderr)

met.cpp:4: warning: ignoring '#pragma GCC ' [-Wunknown-pragmas]
    4 | #pragma GCC ("avx,avx2,fma")
      |
#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...