제출 #869794

#제출 시각아이디문제언어결과실행 시간메모리
869794MercubytheFirstNadan (COCI18_nadan)C++17
50 / 50
0 ms348 KiB
/* */ #include<iostream> #include<vector> #include<iomanip> #include<algorithm> #include<map> #include<set> #include<climits> #include<numeric> #include<queue> #include<unordered_map> #include<string> #include<climits> #include<unordered_set> #include<bitset> #include<cstring> #include<cmath> #include<stack> #include<tuple> #include<complex> #if 1 #define pb push_back #define endl '\n' #define fi first #define se second #define fio ios_base::sync_with_stdio(false);cin.tie(NULL); #define CDIV(a,b) (((a)+(b)-(1))/(b)) using namespace std; using ll = long long; using ld = long double; const ll inf = 1e9 + 5; const ll mod = 998244353; const ll N = 1e6 + 4; const ld PI = acos((ld)-1); #endif void fileio(string s = "test"){ #ifndef ONLINE_JUDGE freopen((s+string(".in")).c_str(),"r",stdin); freopen((s+string(".out")).c_str(),"w",stdout); #endif } ll bpow(ll a, ll p) { if(a == 0 or a == 1)return a; ll ans = 1; while(p) { if(p&1)ans = ans * a % mod; a = a * a % mod; p >>= 1; } return ans; } ll add(ll a, ll b){ if(a + b >= mod) return a + b - mod; return a + b; } ll sub(ll a, ll b){ if(a - b >= 0) return a - b; return a - b + mod; } ll mul(ll a, ll b){ return (a%mod)*(b%mod)%mod; } inline void solve(){ int sum, n; cin >> sum >> n; int cnt = 1; for(int i = 1; i < n; ++i){ cout << cnt << endl; sum -= cnt; cnt++; } cout << sum << endl; } signed main(){ // fileio(); fio; //int t = 0;cin >> t;while(t-->0) solve(); } /* 2 9 9 3 1 1 3 8 8 8 */

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

nadan.cpp: In function 'void fileio(std::string)':
nadan.cpp:45:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |         freopen((s+string(".in")).c_str(),"r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nadan.cpp:46:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   46 |         freopen((s+string(".out")).c_str(),"w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...