제출 #1276835

#제출 시각아이디문제언어결과실행 시간메모리
1276835nguyenhuuhongquan선물 (IOI25_souvenirs)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define double long double #define ull unsigned long long #define BIG __int128 #define fi first #define se second #define MASK(i) (1ll << i) #define BIT(x, i) (((x) >> (i)) & 1) #define sz(x) (int)(x).size() #define debug cout << "NO ERROR", exit(0); #define TASK "txt" #define IOS ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); const int MOD = 1e9 + 7; const int INF = 1e18; const int LimN = 1e5 + 5; void maximize(int &x, int y){ x = max(x, y); } void minimize(int &x, int y){ x = min(x, y); } void add(int &x, int y){ x = (x % MOD + y % MOD) % MOD; } #ifdef LOCAL void buy_souvenirs(int N, long long P0){ transaction(P0 - 1); } #endif void solve(){ } // Authors: Nguyen Huu Hong Quan from Tay Son Secondary school Da Nang signed main(){ IOS; if (fopen(TASK".inp", "r")){ (void)freopen(TASK".inp", "r", stdin); (void)freopen(TASK".out", "w", stdout); } int Q = 1, NumTest = 0; //cin >> Q; for (int i = 1; i <= Q; i ++){ if (NumTest) cout << "Case #" << i << ": "; solve(); } }

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

souvenirs.cpp:15:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   15 | const int INF = 1e18;
      |                 ^~~~
souvenirs.cpp: In function 'int main()':
souvenirs.cpp:37:22: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |         (void)freopen(TASK".inp", "r", stdin);
      |               ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
souvenirs.cpp:38:22: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   38 |         (void)freopen(TASK".out", "w", stdout);
      |               ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cc3wcBn5.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccFTNj7o.o:souvenirs.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc3wcBn5.o: in function `main':
stub.cpp:(.text.startup+0x99): undefined reference to `buy_souvenirs(int, long long)'
collect2: error: ld returned 1 exit status