結果

問題 No.3010 水色コーダーさん
ユーザー yuutyann
提出日時 2025-01-25 12:43:07
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 3,521 ms
コンパイル使用メモリ 274,328 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-01-25 22:18:42
合計ジャッジ時間 6,196 ms
ジャッジサーバーID
(参考情報)
judge7 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:16: warning: ‘ans’ may be used uninitialized [-Wmaybe-uninitialized]
   12 |             ans++;
      |             ~~~^~
main.cpp:5:21: note: ‘ans’ was declared here
    5 |     int n = 0,m = 0,ans;
      |                     ^~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n = 0,m = 0,ans;
    cin >> n >> m;
    for (int i = 0;i < n;i++) {
        string s = "";
        int r = 0;
        cin >> s >> r;
        if (1200 <= r && ((s.substr(0,4)).contains("x"))) {
            ans++;
        }
    }
    cout << ans << endl;
}
0