답안 #62037

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
62037 2018-07-27T09:29:07 Z Darksinian 운세 보기 2 (JOI14_fortune_telling2) C++14
4 / 100
3000 ms 1260 KB
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
long long a[100002];
long long b[100002];
long long v[100002];
int main()
{
    ios_base::sync_with_stdio(false);
    int n,k;
    cin >> n >> k;
    for(int i =0;i<n;i++){
        long long f,g;
        cin >> f >> g;
        a[i] = f;
        b[i] = g;
        v[i] = a[i];
    }
    for(int i =0;i<k;i++) {
        long long t;
        cin >> t;
        for(int j=0;j<n;j++){
            if(t >= v[j]) {
                if(v[j] == a[j]) v[j] = b[j];
                else v[j] = a[j];
            }
        }
    }
    long long sum = 0;
    for(int i =0;i<n;i++){
        sum+=v[i];
    }
    cout << sum << endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 376 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 8 ms 432 KB Output is correct
4 Correct 9 ms 560 KB Output is correct
5 Correct 9 ms 560 KB Output is correct
6 Correct 10 ms 560 KB Output is correct
7 Correct 10 ms 564 KB Output is correct
8 Correct 5 ms 564 KB Output is correct
9 Correct 4 ms 640 KB Output is correct
10 Correct 4 ms 640 KB Output is correct
11 Correct 10 ms 640 KB Output is correct
12 Correct 10 ms 640 KB Output is correct
13 Correct 9 ms 640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 376 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 8 ms 432 KB Output is correct
4 Correct 9 ms 560 KB Output is correct
5 Correct 9 ms 560 KB Output is correct
6 Correct 10 ms 560 KB Output is correct
7 Correct 10 ms 564 KB Output is correct
8 Correct 5 ms 564 KB Output is correct
9 Correct 4 ms 640 KB Output is correct
10 Correct 4 ms 640 KB Output is correct
11 Correct 10 ms 640 KB Output is correct
12 Correct 10 ms 640 KB Output is correct
13 Correct 9 ms 640 KB Output is correct
14 Correct 584 ms 876 KB Output is correct
15 Correct 2281 ms 1108 KB Output is correct
16 Execution timed out 3014 ms 1260 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 376 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 8 ms 432 KB Output is correct
4 Correct 9 ms 560 KB Output is correct
5 Correct 9 ms 560 KB Output is correct
6 Correct 10 ms 560 KB Output is correct
7 Correct 10 ms 564 KB Output is correct
8 Correct 5 ms 564 KB Output is correct
9 Correct 4 ms 640 KB Output is correct
10 Correct 4 ms 640 KB Output is correct
11 Correct 10 ms 640 KB Output is correct
12 Correct 10 ms 640 KB Output is correct
13 Correct 9 ms 640 KB Output is correct
14 Correct 584 ms 876 KB Output is correct
15 Correct 2281 ms 1108 KB Output is correct
16 Execution timed out 3014 ms 1260 KB Time limit exceeded
17 Halted 0 ms 0 KB -