結果
問題 |
No.1032 数数え
|
ユーザー |
|
提出日時 | 2020-12-21 17:14:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 287 bytes |
コンパイル時間 | 1,510 ms |
コンパイル使用メモリ | 167,488 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-21 13:00:46 |
合計ジャッジ時間 | 2,545 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 10 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:6:23: warning: 'm' is used uninitialized [-Wuninitialized] 6 | vector<int32_t> a(m + 1, 0); | ~~^~~ main.cpp:5:14: note: 'm' was declared here 5 | int32_t n, m; | ^ main.cpp:7:21: warning: 'n' may be used uninitialized [-Wmaybe-uninitialized] 7 | for (int i = 0; i < n; i++) { | ~~^~~ main.cpp:5:11: note: 'n' was declared here 5 | int32_t n, m; | ^
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int32_t n, m; vector<int32_t> a(m + 1, 0); for (int i = 0; i < n; i++) { int x; cin >> x; if (x <= m) a[x]++; } for (int i = 0; i < m; i++) { cout << i + 1 << ' ' << a[i + 1] << '\n'; } return 0; }