# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
53479 | 2018-06-30T05:45:12 Z | !?!?(#2015) | Garage (IOI09_garage) | C++11 | 5 ms | 700 KB |
#include<bits/stdc++.h> using namespace std; int N, M; int R[101010]; int W[101010]; //R*W int pos[101010]; queue<int> Q; int main() { scanf("%d%d", &N, &M); for(int i=1; i<=N; ++i) scanf("%d", R+i); for(int i=1; i<=M; ++i) scanf("%d", W+i); int ans = 0; for(int i=0; i<2*M; ++i) { int t; scanf("%d", &t); if(t>0) Q.push(t); else { for(int i=1; i<=N; ++i) if(pos[i] == -t) pos[i] = 0; } for(int i=1; i<=N; ++i) { if(pos[i] == 0 && !Q.empty()) { pos[i] = Q.front(); Q.pop(); ans += R[i] * W[pos[i]]; printf("%d %d\n", i, pos[i]); } } } printf("%d\n", ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 380 KB | Output isn't correct |
2 | Incorrect | 2 ms | 380 KB | Output isn't correct |
3 | Incorrect | 2 ms | 416 KB | Output isn't correct |
4 | Incorrect | 2 ms | 436 KB | Output isn't correct |
5 | Incorrect | 2 ms | 492 KB | Output isn't correct |
6 | Incorrect | 2 ms | 568 KB | Output isn't correct |
7 | Incorrect | 3 ms | 692 KB | Output isn't correct |
8 | Incorrect | 2 ms | 692 KB | Output isn't correct |
9 | Incorrect | 2 ms | 692 KB | Output isn't correct |
10 | Incorrect | 2 ms | 692 KB | Output isn't correct |
11 | Incorrect | 3 ms | 692 KB | Output isn't correct |
12 | Incorrect | 3 ms | 692 KB | Output isn't correct |
13 | Incorrect | 2 ms | 692 KB | Output isn't correct |
14 | Incorrect | 3 ms | 692 KB | Output isn't correct |
15 | Incorrect | 3 ms | 692 KB | Output isn't correct |
16 | Incorrect | 3 ms | 692 KB | Output isn't correct |
17 | Incorrect | 3 ms | 692 KB | Output isn't correct |
18 | Incorrect | 4 ms | 692 KB | Output isn't correct |
19 | Incorrect | 5 ms | 692 KB | Output isn't correct |
20 | Incorrect | 5 ms | 700 KB | Output isn't correct |