| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1137755 | SmuggingSpun | Fortune Telling 2 (JOI14_fortune_telling2) | C++20 | 3 ms | 328 KiB |
#include<bits/stdc++.h>
#define taskname "B"
using namespace std;
typedef long long ll;
int n, k;
namespace sub1{
const int lim = 1e3 + 5;
int a[lim][2];
void solve(){
for(int i = 1; i <= n; i++){
cin >> a[i][0] >> a[i][1];
}
for(int _ = 0; _ < k; _++){
int x;
cin >> x;
for(int i = 1; i <= n; i++){
if(a[i][0] <= x){
swap(a[i][0], a[i][1]);
}
}
}
ll ans = 0;
for(int i = 1; i <= n; i++){
ans += a[i][0];
}
cout << ans;
}
}
namespace sub23{
void solve(){
}
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(taskname".inp", "r")){
freopen(taskname".inp", "r", stdin);
}
cin >> n >> k;
if(max(n, k) <= 1000){
sub1::solve();
}
else{
sub23::solve();
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
