제출 #369496

#제출 시각아이디문제언어결과실행 시간메모리
369496MilosMilutinovic은행 (IZhO14_bank)C++14
0 / 100
1 ms512 KiB
#include <bits/stdc++.h>
using namespace std;
const int N=25;
int n,m,a[N],b[N];
int main(){
	scanf("%i%i",&n,&m);
	for(int i=1;i<=n;i++)scanf("%i",&a[i]);
	for(int i=1;i<=m;i++)scanf("%i",&b[i]);
	sort(a+1,a+n+1);
	sort(b+1,b+m+1);
	if(n==1){
		int sum=accumulate(b+1,b+m+1,0);
		if(sum>=a[0])printf("YES");
		else printf("NO");
	}
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

bank.cpp: In function 'int main()':
bank.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    6 |  scanf("%i%i",&n,&m);
      |  ~~~~~^~~~~~~~~~~~~~
bank.cpp:7:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    7 |  for(int i=1;i<=n;i++)scanf("%i",&a[i]);
      |                       ~~~~~^~~~~~~~~~~~
bank.cpp:8:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    8 |  for(int i=1;i<=m;i++)scanf("%i",&b[i]);
      |                       ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...