Submission #321276

# Submission time Handle Problem Language Result Execution time Memory
321276 2020-11-11T20:41:40 Z larissa_verde Fortune Telling 2 (JOI14_fortune_telling2) 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 -