제출 #1270934

#제출 시각아이디문제언어결과실행 시간메모리
1270934fucfanFeast (NOI19_feast)C++20
4 / 100
23 ms1608 KiB
#include<bits/stdc++.h> #define fi first #define se second #define ull unsigned long long #define ll long long #define BIT(a , b) (((a) >> (b)) & 1) #define flip(a , b) ((a) ^ (1ll << (b))) #define pii pair<int, int> #define pb push_back #define nl cout << "\n"; #define __ <<" "<< #define mem(a, b) memset((a), (b), sizeof((a))) #define all(c) (c).begin(), (c).end() #define add(x , y) ((x) + (y) >= mod ? ((x) + (y) - mod) : ((x) + (y))) #define sub(x , y) ((x) - (y) < 0 ? ((x) - (y) + mod) : ((x) - (y))) #define file "F:/cp/test" #define Times cerr << "\nTime run: " << clock() / 1000.0 << " ms\n"; template <typename T1, typename T2> bool mini(T1 &a, T2 b) {if (a > b) {a = b; return 1;} return 0;} template <typename T1, typename T2> bool maxi(T1 &a, T2 b) {if (a < b) {a = b; return 1;} return 0;} using namespace std; const ll loo = 1e18 + 7; const int oo = 1e9 + 7; const int mod = 1e9 + 7; const int N = 3e5 + 5; const int LOG = 20; const int base = 31; void run_with_file(){ if(fopen(file".inp" , "r")){ freopen(file".inp", "r" , stdin); freopen(file".out", "w" , stdout); } } int n, a[N], k; pair<ll, ll> dp[N][2]; void inp(){ cin >> n >> k; for(int i = 1; i <= n; i++){ cin >> a[i]; } } void solve(){ ll res = 0; for(int i = 1; i <= n; i++) res += a[i]; cout << res << '\n'; } int main(){ cin.tie(0)->sync_with_stdio(false); // run_with_file(); int test_case = 1; //cin >> test_case; while(test_case--){ inp(); solve(); } } /* UwU */

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

feast.cpp: In function 'void run_with_file()':
feast.cpp:31:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |         freopen(file".inp", "r" , stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
feast.cpp:32:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |         freopen(file".out", "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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...