답안 #815104

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
815104 2023-08-08T12:25:15 Z jajco Sightseeing in Kyoto (JOI22_kyoto) C++17
10 / 100
8 ms 8204 KB
#include <ios>
#include <vector>
#define REP(i, n) for(int i=0; i<n; ++i)
#define INF 1e18
typedef long long ll;
typedef std::vector <int> vi;
typedef std::vector <ll> vll;
void M(ll &i, const ll j){
    i=std::min(i, j);
}
int main(){
    int n,m; // n to kolumny!
    scanf("%d%d", &n, &m);
    if (n>1000||m>1000)
        return 69;
    vi kol(n),wier(m);
    REP(i, n)
        scanf("%d", &kol[i]);
    REP(i, m)
        scanf("%d", &wier[i]);
    std::vector <vll> odl(n+1, vll(m+1, INF));
    odl[0][0]=0;
    REP(x, n)
        REP(y, m){
            M(odl[x+1][y], odl[x][y]+wier[y]);
            M(odl[x][y+1], odl[x][y]+kol[x]);
        }
    printf("%lld\n", odl[n-1][m-1]);
}

Compilation message

kyoto.cpp: In function 'int main()':
kyoto.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     scanf("%d%d", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~
kyoto.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |         scanf("%d", &kol[i]);
      |         ~~~~~^~~~~~~~~~~~~~~
kyoto.cpp:20:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |         scanf("%d", &wier[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 288 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 676 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 288 KB Output is correct
9 Correct 7 ms 8108 KB Output is correct
10 Correct 7 ms 8148 KB Output is correct
11 Correct 7 ms 8148 KB Output is correct
12 Correct 8 ms 8148 KB Output is correct
13 Correct 7 ms 8148 KB Output is correct
14 Correct 7 ms 8108 KB Output is correct
15 Correct 6 ms 8148 KB Output is correct
16 Correct 6 ms 8108 KB Output is correct
17 Correct 7 ms 8204 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 284 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 284 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 288 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Runtime error 0 ms 212 KB Execution failed because the return code was nonzero
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 288 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 676 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 288 KB Output is correct
9 Correct 7 ms 8108 KB Output is correct
10 Correct 7 ms 8148 KB Output is correct
11 Correct 7 ms 8148 KB Output is correct
12 Correct 8 ms 8148 KB Output is correct
13 Correct 7 ms 8148 KB Output is correct
14 Correct 7 ms 8108 KB Output is correct
15 Correct 6 ms 8148 KB Output is correct
16 Correct 6 ms 8108 KB Output is correct
17 Correct 7 ms 8204 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 284 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 284 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 1 ms 288 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Runtime error 0 ms 212 KB Execution failed because the return code was nonzero
32 Halted 0 ms 0 KB -