結果
問題 |
No.480 合計
|
ユーザー |
|
提出日時 | 2020-05-08 13:48:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,274 bytes |
コンパイル時間 | 2,048 ms |
コンパイル使用メモリ | 176,908 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-03 09:49:50 |
合計ジャッジ時間 | 2,937 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:44:7: warning: 'sum' may be used uninitialized [-Wmaybe-uninitialized] 44 | int sum; | ^~~
ソースコード
// #define DEBUG_ON #pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define timer_start() \ chrono::system_clock::time_point start, end; \ start = chrono::system_clock::now(); #define timer_wrap() \ end = chrono::system_clock::now(); \ double time = static_cast<double>( \ chrono::duration_cast<chrono::microseconds>(end - start).count() / \ 1000.0); \ printf("time %lf[ms]\n", time); \ start = end; #define optimize_cin() \ cin.tie(0); \ ios::sync_with_stdio(false) using namespace std; using ll = long long; #define INF 1000000000 // 10^9 template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } int main() { // input int t; cin >> t; #ifdef DEBUG_ON timer_start(); #endif int sum; for (int i = 1; i <= t; i++) { sum += i; } cout << sum << endl; #ifdef DEBUG_ON timer_wrap(); #endif return 0; }