답안 #637780

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
637780 2022-09-03T08:22:56 Z ksu2009en Colouring a rectangle (eJOI19_colouring) C++17
0 / 100
301 ms 6552 KB
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <cmath>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <bitset>
#include <cstring>

using namespace std;
typedef long long ll;


int main(){
    ll m, n;
    cin >> m >> n;
    vector<ll>down(n + m - 1), up(n + m - 1);
    
    for(int i = 0; i < down.size(); i++)
        cin >> down[i];
    
    for(int i = 0; i < up.size(); i++)
        cin >> up[i];
    
    ll ans = 0;
    
    for(int i = 0; i < m; i++){
        //cout << down[i] << ' ' << up[n - i - 1] << endl;
        ans += min(down[n - i - 1], up[i]);
    }
    
    cout << ans << endl;
    
    return 0;
}
/*
 3 1
 3 4 5
 1 2 90
 
 */

Compilation message

colouring.cpp: In function 'int main()':
colouring.cpp:26:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for(int i = 0; i < down.size(); i++)
      |                    ~~^~~~~~~~~~~~~
colouring.cpp:29:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     for(int i = 0; i < up.size(); i++)
      |                    ~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 147 ms 3416 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 301 ms 6552 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -