Submission #310192

#TimeUsernameProblemLanguageResultExecution timeMemory
310192LifeHappen__Nadan (COCI18_nadan)C++14
50 / 50
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; #define ar array #define ii pair<int, int> #define fi first #define se second #define pb push_back #define eb emplace_back #define all(a) begin(a), end(a) const int N = 1e5 + 5; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define task "nadan" if(fopen(task".inp", "r")) { freopen(task".inp", "r", stdin); freopen(task".out", "w", stdout); } int n, k; cin >> k >> n; for (int i = 1; i < n; ++i) { cout << i << '\n'; k -= i; } cout << k << '\n'; }

Compilation message (stderr)

nadan.cpp: In function 'int32_t main()':
nadan.cpp:21:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   21 |     freopen(task".inp", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
nadan.cpp:22:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   22 |     freopen(task".out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...