제출 #1250010

#제출 시각아이디문제언어결과실행 시간메모리
1250010haiphong5g0선물 (IOI25_souvenirs)C++20
컴파일 에러
0 ms0 KiB
#include "souvenirs.h" #include <bits/stdc++.h> #define task "TEST" #define task2 "A" #define pl pair<ll, ll> #define pf push_front #define pb push_back #define pob pop_back #define pof pop_front #define mp make_pair #define fi first #define se second #define FOR(i, a, b, c) for (int i=a; i<=b; i+=c) #define FORE(i, a, b, c) for (int i=a; i>=b; i+=c) using namespace std; using ll = long long; using ull = unsigned long long; const int Mod = 998244353; const int maxn = 1e6; const ll Inf = 1e16; pair<vector<int>, ll> res; ll P[maxn+1], num[maxn+1]; void Sub2_3(ll n) { FOR(i, 1, n-2, 1) { res = transaction(P[i-1]-2); for (auto p : res.fi) num[p]++; if (res.fi[0] != i) P[i] = P[i-1] - 1; else P[i] = P[i-1] - 2; } FOR(i, 1, n-2, 1) FOR(j, num[i], i-1, 1) transaction(P[i]); FOR(j, num[n-1], n-2, 1) transaction(P[n-1]-1); } // std::pair<std::vector<int>, long long> transaction(long long M) void buy_souvenirs(int n, long long P0) { P[0] = P0; if (n == 2) transaction(P[0]-1); else if (n == 3) { res = transcation(P[0]-1); if (res.fi.size() == 1) { transaction(P[0]-res.se-2); transaction(P[0]-res.se-2); } else transaction((P[0]-1-res.se)/2); } else Sub2_3(n); } int main() { if (fopen (task".inp", "r")) { freopen (task".inp", "r", stdin); freopen (task".out", "w", stdout); } ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; //Sieve(); for (t=1; t--;) { //Read(); Solve(); } }

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

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:39:15: error: 'transcation' was not declared in this scope; did you mean 'transaction'?
   39 |         res = transcation(P[0]-1);
      |               ^~~~~~~~~~~
      |               transaction
souvenirs.cpp: In function 'int main()':
souvenirs.cpp:51:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |         freopen (task".inp", "r", stdin);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
souvenirs.cpp:52:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   52 |         freopen (task".out", "w", stdout);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~