답안 #98929

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
98929 2019-02-27T14:53:11 Z Sa1loum Cipele (COCI18_cipele) C++14
18 / 90
74 ms 3076 KB
#include <bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mem(a,b) memset(a, b, sizeof(a))
#define F first
#define S second
#define Si size
#define pb(x) push_back(x)
typedef double D;
typedef long long ll;
typedef long double ld;
const int MOD=(int)1e9+7,MAX=(int)1e5+10;
int n,m,a[MAX],b[MAX];
int main()
{
    scanf("%d%d",&n,&m);
    if (n<m) {
        for (int i=0;i<n;i++) {
            scanf("%d",&a[i]);
        }
        for (int i=0;i<m;i++) {
            scanf("%d",&b[i]);
        }
    }
    else {
        for (int i=0;i<n;i++) {
            scanf("%d",&b[i]);
        }
        for (int i=0;i<m;i++) {
            scanf("%d",&a[i]);
        }
        swap(n,m);
    }
    sort(a,a+n);
    sort(b,b+m);
    if (n==m) {
        int mx=-1;
        for (int i=0;i<n;i++) {
            int o=fabs(a[i]-b[i]);
            mx=max(mx,o);
        }
        cout<<mx<<endl;
        return 0;
    }


}

Compilation message

cipele.cpp: In function 'int main()':
cipele.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
cipele.cpp:19:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&a[i]);
             ~~~~~^~~~~~~~~~~~
cipele.cpp:22:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&b[i]);
             ~~~~~^~~~~~~~~~~~
cipele.cpp:27:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&b[i]);
             ~~~~~^~~~~~~~~~~~
cipele.cpp:30:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&a[i]);
             ~~~~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 2680 KB Output is correct
2 Correct 48 ms 3064 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 3076 KB Output is correct
2 Correct 74 ms 2908 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 47 ms 2424 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 43 ms 2680 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 38 ms 2440 KB Output isn't correct
2 Halted 0 ms 0 KB -