結果
問題 |
No.280 歯車の問題(1)
|
ユーザー |
|
提出日時 | 2019-01-09 22:32:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 311 bytes |
コンパイル時間 | 1,762 ms |
コンパイル使用メモリ | 164,808 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 01:00:38 |
合計ジャッジ時間 | 4,075 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:18:15: warning: 'bottom' may be used uninitialized [-Wmaybe-uninitialized] 18 | printf("%lld/%lld\n", top, bottom); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:11:24: note: 'bottom' was declared here 11 | long long top, bottom; | ^~~~~~ main.cpp:18:15: warning: 'top' may be used uninitialized [-Wmaybe-uninitialized] 18 | printf("%lld/%lld\n", top, bottom); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:11:19: note: 'top' was declared here 11 | long long top, bottom; | ^~~
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; long long top, bottom; for(int i = 0; i < n; i++) { long long z; cin >> z; if(i == 0) bottom = z; if(i == n - 1) top = z; } printf("%lld/%lld\n", top, bottom); return 0; }