Submission #321277

# Submission time Handle Problem Language Result Execution time Memory
321277 2020-11-11T20:44:39 Z larissa_verde Fortune Telling 2 (JOI14_fortune_telling2) C++17
4 / 100
3000 ms 2148 KB
#include <bits/stdc++.h>
#define MAXN 200000
using namespace std;

struct carta{
	unsigned long long frente=0,verso=0;
};

carta sequencia[MAXN];

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

	int n=0,k=0;
	unsigned long long 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;
}

Compilation message

fortune_telling2.cpp: In function 'int main()':
fortune_telling2.cpp:26:28: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'int' [-Wsign-compare]
   26 |    if (sequencia[i].frente <= t) swap(sequencia[i].frente, sequencia[i].verso);
      |        ~~~~~~~~~~~~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 2 ms 364 KB Output is correct
3 Correct 4 ms 364 KB Output is correct
4 Correct 4 ms 364 KB Output is correct
5 Correct 4 ms 364 KB Output is correct
6 Correct 4 ms 364 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 3 ms 492 KB Output is correct
9 Correct 2 ms 364 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 4 ms 364 KB Output is correct
12 Correct 4 ms 364 KB Output is correct
13 Correct 4 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 2 ms 364 KB Output is correct
3 Correct 4 ms 364 KB Output is correct
4 Correct 4 ms 364 KB Output is correct
5 Correct 4 ms 364 KB Output is correct
6 Correct 4 ms 364 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 3 ms 492 KB Output is correct
9 Correct 2 ms 364 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 4 ms 364 KB Output is correct
12 Correct 4 ms 364 KB Output is correct
13 Correct 4 ms 364 KB Output is correct
14 Correct 349 ms 840 KB Output is correct
15 Correct 1353 ms 1280 KB Output is correct
16 Correct 2996 ms 1636 KB Output is correct
17 Execution timed out 3039 ms 2148 KB Time limit exceeded
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 2 ms 364 KB Output is correct
3 Correct 4 ms 364 KB Output is correct
4 Correct 4 ms 364 KB Output is correct
5 Correct 4 ms 364 KB Output is correct
6 Correct 4 ms 364 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 3 ms 492 KB Output is correct
9 Correct 2 ms 364 KB Output is correct
10 Correct 2 ms 364 KB Output is correct
11 Correct 4 ms 364 KB Output is correct
12 Correct 4 ms 364 KB Output is correct
13 Correct 4 ms 364 KB Output is correct
14 Correct 349 ms 840 KB Output is correct
15 Correct 1353 ms 1280 KB Output is correct
16 Correct 2996 ms 1636 KB Output is correct
17 Execution timed out 3039 ms 2148 KB Time limit exceeded
18 Halted 0 ms 0 KB -