제출 #1055422

#제출 시각아이디문제언어결과실행 시간메모리
1055422KasymK밀림 점프 (APIO21_jumps)C++17
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #define ff first #define ss second #define all(v) v.begin(), v.end() #define ll long long #define pb push_back #define pii pair<int, int> #define wr puts("----------------") template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;} void init(int n, vector<int> v){} int minimum_jumps(int a, int b, int c, int d){ printf("%d\n", c-b); } int main(){ int n, q; scanf("%d%d", &n, &q); vector<int> h; for(int i = 0; i < n; ++i){ int x; scanf("%d", &x); h.pb(x); } init(n, h); while(q--){ int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d); int answer = minimum_jumps(a, b, c, d); printf("%d\n", answer); } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

jumps.cpp: In function 'int minimum_jumps(int, int, int, int)':
jumps.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
jumps.cpp: In function 'int main()':
jumps.cpp:21:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |     scanf("%d%d", &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~
jumps.cpp:25:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |         scanf("%d", &x);
      |         ~~~~~^~~~~~~~~~
jumps.cpp:31:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |         scanf("%d%d%d%d", &a, &b, &c, &d);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cca4teId.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccEQqedg.o:jumps.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status