結果

問題 No.1940 Escape through + -
ユーザー Hiroyuki YamanouchiHiroyuki Yamanouchi
提出日時 2022-05-20 22:59:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 732 bytes
コンパイル時間 1,934 ms
コンパイル使用メモリ 166,884 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 13:51:44
合計ジャッジ時間 3,159 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
4,348 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,348 KB
testcase_19 WA -
testcase_20 AC 6 ms
4,348 KB
testcase_21 AC 6 ms
4,348 KB
testcase_22 AC 6 ms
4,348 KB
testcase_23 WA -
testcase_24 AC 41 ms
4,348 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 45 ms
4,348 KB
testcase_28 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:33:12: warning: 'total' may be used uninitialized [-Wmaybe-uninitialized]
   33 |     if (abs(total-S) % M == 0) ans = "Yes";
      |         ~~~^~~~~~~~~
main.cpp:25:8: note: 'total' was declared here
   25 |     ll total;
      |        ^~~~~

ソースコード

diff #

#include <bits/stdc++.h>
#include <regex>
using namespace std;
using ll = int64_t;
#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()

// -------------------------------
// 2022/5/20 Hiroyuki Yamanouchi
// AtCoder Rating 187 10級
// -------------------------------

// void chmax(ll& a, ll b){ if(a < b) a = b; }
// void chmin(ll& a, ll b){ if(a > b) a = b; }
// for (int i = 0; i < N; i++){    
//      cin >> P[i];
// }


int main() {
 
    ll N,M,S;
    cin >> N >> M >> S;

    ll total;
    for (int i = 0; i < N; i++){   
        ll A;
        cin >> A;
        total += A;
    }

    string ans;
    if (abs(total-S) % M == 0) ans = "Yes";
    else ans = "No";

    cout << ans << endl;

    return 0;
}


0