답안 #170764

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
170764 2019-12-26T09:52:53 Z arnold518 Naan (JOI19_naan) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> pll;

int N, M;
bool chk[2020];
LL V[2020][2020];
pll C[2020][2020];
vector<int> P;

bool comp(pll a, pll b){
    return (__int128)a.first*b.second < (__int128)a.second*b.first;
}

int main(){
    scanf("%d %d", &N, &M);
    for (int i=1; i<=N; i++){
        LL S=0, sum=V[i][1];
        for (int j=1; j<=N; j++) S += V[i][j];

        int t=1;
        for (int j=1; j<=N; j++){
            while (sumN < Sj){
                t++;
                sum += V[i][t];
            }
            LL p = Sj-Nsum+V[i][t]N*t;
            LL q = V[i][t] * N;
            C[i][j] = pll(p, q);
        }
    }
    for (int i=1; i<N; i++){
        pll Min=pll(1234567890123456ll, 1);
        int k=0;

        for (int j=1; j<=N; j++) if (!chk[j] && comp(C[j][i], Min)) Min = C[j][i], k = j;
        printf("%lld %lld\n", Min.first, Min.second);
        P.push_back(k);
        chk[k] = true;
    }
    for (int x : P) printf("%d ", x);
    for (int i=1; i<=N; i++) if (!chk[i]) printf("%d\n", i);
    return 0;
}

Compilation message

naan.cpp: In function 'int main()':
naan.cpp:24:20: error: 'sumN' was not declared in this scope
             while (sumN < Sj){
                    ^~~~
naan.cpp:24:20: note: suggested alternative: 'sum'
             while (sumN < Sj){
                    ^~~~
                    sum
naan.cpp:24:27: error: 'Sj' was not declared in this scope
             while (sumN < Sj){
                           ^~
naan.cpp:24:27: note: suggested alternative: 'j'
             while (sumN < Sj){
                           ^~
                           j
naan.cpp:28:20: error: 'Sj' was not declared in this scope
             LL p = Sj-Nsum+V[i][t]N*t;
                    ^~
naan.cpp:28:20: note: suggested alternative: 'j'
             LL p = Sj-Nsum+V[i][t]N*t;
                    ^~
                    j
naan.cpp:28:23: error: 'Nsum' was not declared in this scope
             LL p = Sj-Nsum+V[i][t]N*t;
                       ^~~~
naan.cpp:28:23: note: suggested alternative: 'sum'
             LL p = Sj-Nsum+V[i][t]N*t;
                       ^~~~
                       sum
naan.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &N, &M);
     ~~~~~^~~~~~~~~~~~~~~~~