Submission #321275

# Submission time Handle Problem Language Result Execution time Memory
321275 2020-11-11T20:33:47 Z larissa_verde Remittance (JOI19_remittance) C++17
0 / 100
1 ms 364 KB
#include <bits/stdc++.h>
#define MAXN 200000
using namespace std;

struct carta{
	int frente=0,verso=0;
};

carta sequencia[MAXN];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int n=0,k=0,soma=0;
	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		cin >> sequencia[i].frente >> sequencia[i].verso;
	}
	while (k--) {
		int t=0;
		cin >> t;
		for (int i = 0; i < n; i++) {
			if (sequencia[i].frente <= t) swap(sequencia[i].frente, sequencia[i].verso);
		}
	}

	for (int i = 0; i < n; i++) {
		soma += sequencia[i].frente;
	}
	cout << soma;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -