답안 #336513

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
336513 2020-12-15T13:43:53 Z mehrdad_sohrabi 항공 노선도 (JOI18_airline) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "Alicelib.h"
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair < ll , ll >
#define F first
#define S second
#define endl '\n'
//#define int long long
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define kill(x) return cout<<x<<'\n', 0;
using namespace std;
void Alice( int n,int m,int A[],int B[]){
    vector <int> ras;
    for (int i=n;i<n+12;i++){
        ras.pb(i);
    }
    vector <pii> mm;
    for (int i=0;i<m;i++){
        mm.pb({A[i],B[i]});
    }
    for (int i=n+1;i<n+11;i++){
        mm.pb({n,i});
        mm.pb({i,n+11});
    }
    for (int i=n+2;i<n+11;i++){
        mm.pb({i,i-1});
    }
    for (int i=0;i<n;i++){
        mm.pb({i,n+11});
    }
    for (int i=0;i<n;i++){
        for (int j=0;j<10;j++){
            if ((i & (1<<j))){
                mm.pb({i,n+1+j});
            }
        }
    }
    
    InitG(n+12,mm.size());
    for (int i=0;i<mm.size();i++){
        MakeG(i, mm[i].F, mm[i].S);
    }
    /*
    cout << n+12 << " " << mm.size() << endl;
    for (int i=0;i<mm.size();i++){
        cout << mm[i].F << " ";
    }
    cout << endl;
    for (int i=0;i<mm.size();i++){
        cout << mm[i].S << " ";
    }
    */
}
/*
int a[100],b[100];
int32_t main(){
    int n,m;
    cin >> n >> m;
    for (int i=0;i<m;i++){
        cin >> a[i] >> b[i];
    }
    Alice(n,m,a,b);
}
*/
#include <bits/stdc++.h>
#include "Alicelib.h"
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair < ll , ll >
#define F first
#define S second
#define endl '\n'
//#define int long long
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define kill(x) return cout<<x<<'\n', 0;
using namespace std;
void Alice( int n,int m,int A[],int B[]){
    vector <int> ras;
    for (int i=n;i<n+12;i++){
        ras.pb(i);
    }
    vector <pii> mm;
    for (int i=0;i<m;i++){
        mm.pb({A[i],B[i]});
    }
    for (int i=n+1;i<n+11;i++){
        mm.pb({n,i});
        mm.pb({i,n+11});
    }
    for (int i=n+2;i<n+11;i++){
        mm.pb({i,i-1});
    }
    for (int i=0;i<n;i++){
        mm.pb({i,n+11});
    }
    for (int i=0;i<n;i++){
        for (int j=0;j<10;j++){
            if ((i & (1<<j))){
                mm.pb({i,n+1+j});
            }
        }
    }
    
    InitG(n+12,mm.size());
    for (int i=0;i<mm.size();i++){
        MakeG(i, mm[i].F, mm[i].S);
    }
    /*
    cout << n+12 << " " << mm.size() << endl;
    for (int i=0;i<mm.size();i++){
        cout << mm[i].F << " ";
    }
    cout << endl;
    for (int i=0;i<mm.size();i++){
        cout << mm[i].S << " ";
    }
    */
}
/*
int a[100],b[100];
int32_t main(){
    int n,m;
    cin >> n >> m;
    for (int i=0;i<m;i++){
        cin >> a[i] >> b[i];
    }
    Alice(n,m,a,b);
}
*/

Compilation message

Alice.cpp: In function 'void Alice(int, int, int*, int*)':
Alice.cpp:43:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |     for (int i=0;i<mm.size();i++){
      |                  ~^~~~~~~~~~

Bob.cpp: In function 'void Alice(int, int, int*, int*)':
Bob.cpp:43:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |     for (int i=0;i<mm.size();i++){
      |                  ~^~~~~~~~~~
/tmp/ccc9hW4x.o: In function `main':
grader_bob.cpp:(.text.startup+0xe8): undefined reference to `Bob(int, int, int*, int*)'
/tmp/ccUyjFxi.o: In function `Alice(int, int, int*, int*)':
Bob.cpp:(.text+0xac0): undefined reference to `InitG(int, int)'
Bob.cpp:(.text+0xaec): undefined reference to `MakeG(int, int, int)'
collect2: error: ld returned 1 exit status