結果

問題 No.989 N×Mマス計算(K以上)
ユーザー handai_334handai_334
提出日時 2020-04-15 11:09:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 33,152 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2024-04-09 18:36:19
合計ジャッジ時間 8,198 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 TLE -
testcase_11 WA -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main()
{
    int N,M,K;
    scanf("%d%d%d",&N,&M,&K);
    char op;
    scanf("%c",&op);
    int B[M];
    int A[N];
    int cnt=0;
    for(int i=0;i<M;i++)
    {
        scanf("%d",&B[i]);
    }
    for(int i=0;i<N;i++)
    {
        scanf("%d",&A[i]);
    }
    if(op=='+')
    {
        for(int i=0;i<N;i++)
        {
            for(int j=0;j<M;j++)
            {
                if(A[i]+B[i]>=K) cnt++;
            }
        }
    }
    else if(op='*')
    {
        for(int i=0;i<N;i++)
        {
            for(int j=0;j<M;j++)
            {
                if(A[i]*B[j]>=K) cnt++;
            }
        }
    }

printf("%d",cnt);
}
0