답안 #555623

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
555623 2022-05-01T09:39:30 Z Jarif_Rahman 운세 보기 2 (JOI14_fortune_telling2) C++17
4 / 100
3000 ms 1876 KB
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n, k; cin >> n >> k;

    vector<ll> A(n), B(n);
    vector<ll> T(k);

    for(int i = 0; i < n; i++) cin >> A[i] >> B[i];
    for(int i = 0; i < k; i++) cin >> T[i];

    ll ans = 0;

    for(int i = 0; i < n; i++){
        for(int j = 0; j < k; j++){
            if(T[j] >= A[i]) swap(A[i], B[i]);
        }
        ans+=A[i];
    }

    cout << ans << "\n";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 3 ms 332 KB Output is correct
3 Correct 5 ms 380 KB Output is correct
4 Correct 5 ms 328 KB Output is correct
5 Correct 5 ms 328 KB Output is correct
6 Correct 6 ms 340 KB Output is correct
7 Correct 5 ms 336 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 5 ms 340 KB Output is correct
11 Correct 5 ms 340 KB Output is correct
12 Correct 5 ms 340 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 3 ms 332 KB Output is correct
3 Correct 5 ms 380 KB Output is correct
4 Correct 5 ms 328 KB Output is correct
5 Correct 5 ms 328 KB Output is correct
6 Correct 6 ms 340 KB Output is correct
7 Correct 5 ms 336 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 5 ms 340 KB Output is correct
11 Correct 5 ms 340 KB Output is correct
12 Correct 5 ms 340 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 364 ms 832 KB Output is correct
15 Correct 1963 ms 1368 KB Output is correct
16 Execution timed out 3067 ms 1876 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 3 ms 332 KB Output is correct
3 Correct 5 ms 380 KB Output is correct
4 Correct 5 ms 328 KB Output is correct
5 Correct 5 ms 328 KB Output is correct
6 Correct 6 ms 340 KB Output is correct
7 Correct 5 ms 336 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 5 ms 340 KB Output is correct
11 Correct 5 ms 340 KB Output is correct
12 Correct 5 ms 340 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 364 ms 832 KB Output is correct
15 Correct 1963 ms 1368 KB Output is correct
16 Execution timed out 3067 ms 1876 KB Time limit exceeded
17 Halted 0 ms 0 KB -