Submission #1246968

#TimeUsernameProblemLanguageResultExecution timeMemory
1246968islam_2010Prosjek (COCI14_prosjek)C++20
0 / 50
1 ms320 KiB
#pragma GCC optimize("O3") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; // typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; #define all(x) x.begin(), x.end() #define pii pair<int, int> #define mpr make_pair #define fi first #define se second #define Local #define int long long const int sz = 5005; const long long inf = 1e9 + 7; const int mod = 1e9 + 7; template<typename Iterator> void read(Iterator b, Iterator e) { while (b != e) { cin >> *b++; } } int bin_pow(int x, int b) { int res = 1; while (b > 0) { if (b & 1) { res = (res * x) % mod; } x = (x * x) % mod; b >>= 1; } return res; } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); #ifdef Local freopen("main.in", "r", stdin); freopen("main.out", "w", stdout); #endif int n; cin >> n; vector<int> a(n); for(int i = 0; i < n; i++){ cin >> a[i]; a[i] *= i+1; }int s = 0; int ans = 0; cout << a[0] << " "; for(int i = 1; i < n; i++){ cout << a[i]-a[i-1] << " "; } }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:48:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   48 |         freopen("main.in", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
prosjek.cpp:49:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   49 |         freopen("main.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...