Submission #62033

# Submission time Handle Problem Language Result Execution time Memory
62033 2018-07-27T09:23:43 Z mahmoudbadawy Fortune Telling 2 (JOI14_fortune_telling2) C++17
4 / 100
3000 ms 808 KB
#include <bits/stdc++.h>

using namespace std;

const int N=200005;
int a[N],b[N];
int n,k;

int main()
{
	scanf("%d %d",&n,&k);
	for(int i=0;i<n;i++) scanf("%d %d",&a[i],&b[i]);
	for(int i=0;i<k;i++)
	{
		int x;
		scanf("%d",&x);
		for(int j=0;j<n;j++)
			if(a[j]<=x)
				swap(a[j],b[j]);
	}
	long long sum=0;
	for(int i=0;i<n;i++) sum+=a[i];
	cout << sum << endl;
}

Compilation message

fortune_telling2.cpp: In function 'int main()':
fortune_telling2.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&n,&k);
  ~~~~~^~~~~~~~~~~~~~~
fortune_telling2.cpp:12:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=0;i<n;i++) scanf("%d %d",&a[i],&b[i]);
                       ~~~~~^~~~~~~~~~~~~~~~~~~~~
fortune_telling2.cpp:16:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&x);
   ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 128 KB Output is correct
2 Correct 6 ms 248 KB Output is correct
3 Correct 7 ms 324 KB Output is correct
4 Correct 7 ms 528 KB Output is correct
5 Correct 7 ms 528 KB Output is correct
6 Correct 7 ms 528 KB Output is correct
7 Correct 7 ms 528 KB Output is correct
8 Correct 6 ms 552 KB Output is correct
9 Correct 4 ms 552 KB Output is correct
10 Correct 4 ms 552 KB Output is correct
11 Correct 7 ms 552 KB Output is correct
12 Correct 6 ms 552 KB Output is correct
13 Correct 7 ms 552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 128 KB Output is correct
2 Correct 6 ms 248 KB Output is correct
3 Correct 7 ms 324 KB Output is correct
4 Correct 7 ms 528 KB Output is correct
5 Correct 7 ms 528 KB Output is correct
6 Correct 7 ms 528 KB Output is correct
7 Correct 7 ms 528 KB Output is correct
8 Correct 6 ms 552 KB Output is correct
9 Correct 4 ms 552 KB Output is correct
10 Correct 4 ms 552 KB Output is correct
11 Correct 7 ms 552 KB Output is correct
12 Correct 6 ms 552 KB Output is correct
13 Correct 7 ms 552 KB Output is correct
14 Correct 412 ms 552 KB Output is correct
15 Correct 1544 ms 808 KB Output is correct
16 Execution timed out 3024 ms 808 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 128 KB Output is correct
2 Correct 6 ms 248 KB Output is correct
3 Correct 7 ms 324 KB Output is correct
4 Correct 7 ms 528 KB Output is correct
5 Correct 7 ms 528 KB Output is correct
6 Correct 7 ms 528 KB Output is correct
7 Correct 7 ms 528 KB Output is correct
8 Correct 6 ms 552 KB Output is correct
9 Correct 4 ms 552 KB Output is correct
10 Correct 4 ms 552 KB Output is correct
11 Correct 7 ms 552 KB Output is correct
12 Correct 6 ms 552 KB Output is correct
13 Correct 7 ms 552 KB Output is correct
14 Correct 412 ms 552 KB Output is correct
15 Correct 1544 ms 808 KB Output is correct
16 Execution timed out 3024 ms 808 KB Time limit exceeded
17 Halted 0 ms 0 KB -