제출 #1226967

#제출 시각아이디문제언어결과실행 시간메모리
1226967cpdreamerBoat (APIO16_boat)C++20
0 / 100
1 ms324 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; const long long INF = 1e17; typedef long long ll; const ll MOD = 998244353; #define F first #define pb push_back #define S second #define P pair #define V vector #define all(v) v.begin(), v.end() typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_multiset; void file() { freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); } void solve() { int n; cin>>n; int A[n]; int B[n]; for (int i=0;i<n;i++) { cin>>A[i]>>B[i]; } ll dp[n]; dp[0]=1LL; ll ans=1; for (int i=1;i<n;i++) { dp[i]=1; for (int j=i-1;j>=0;j--) { if (A[j]<A[i]) { dp[i]+=dp[j]; } } ans+=dp[i]; } cout<<ans<<endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); //file(); solve(); }

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

boat.cpp: In function 'void file()':
boat.cpp:16:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     freopen("input.txt","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
boat.cpp:17:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |     freopen("output.txt","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...