結果

問題 No.987 N×Mマス計算(基本)
ユーザー kidhrnkidhrn
提出日時 2020-03-03 13:41:17
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 760 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 29,824 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 23:55:18
合計ジャッジ時間 1,045 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>
#include <stdlib.h>

int main(void) {
    
    int i,j;
    scanf("%d%d",&i,&j);
    
    char Mark[3];
    scanf("%s",Mark);
   
    int X[j],Y[i];
   
    int k,l;
    
    for(int k=0;k<j;k++){
        scanf("%d",&X[k]);}
    for(int l=0;l<i;l++){
        scanf("%d",&Y[l]);}
    
    int *T; T = (int *)malloc(sizeof(int));
    
    if(Mark[0] == '+'){
        for(l=0;l<i;l++){
            for(k=0;k<j;k++){
                *T =X[k] + Y[l];
                printf("%d ",*T); }
            printf("\n"); }}
    
    if(Mark[0] == '*'){
        for(l=0;l<i;l++){
            for(k=0;k<j;k++){
                *T =X[k] * Y[l];
                printf("%d ",*T); }
            printf("\n"); }
       
    }
     free(T);
    
    return 0;
}
0