結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 AC 1 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 2 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 2 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)*100);
    
    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);

    //printf("\n%d,%d,%c\n%d,%d,%d,%d\n%d,%d,%d\n",i,j,Mark[0],X[0],X[1],X[2],X[3],Y[0],Y[1],Y[2]);
    
    return 0;
}
0