結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー 37zigen37zigen
提出日時 2020-09-12 17:37:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 588 bytes
コンパイル時間 1,958 ms
コンパイル使用メモリ 197,156 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-30 16:52:40
合計ジャッジ時間 4,198 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 RE -
testcase_04 AC 1 ms
4,376 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    5 | main() {
      | ^~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace  std;
int s0,s1,s2,t0,t1,t2;

main() {
    int N;
    cin>>N;
    int ans=0;
    for (int i=0;i<N;++i) {
        int s;cin>>s;
        if (s==0) ++s0;
        else if (s==1) ++s1;
        else if (s==2) ++s2;
    }
    for (int i=0;i<N;++i) {
        int t;cin>>t;
        if (t==0) ++t0;
        else if (t==1) ++t1;
        else if (t==2) ++t2;
    }
    int H=N-s0;
    int W=N-t0;
    if (s2>0) {
        ans=W*s2+s1;
    } else if (t2>0) {
        ans=H*t2+t1;
    } else {
        assert(s1==t1);
        ans=s1;
    }
    cout<<ans<<endl;
}
0