結果
問題 | No.606 カラフルタイル |
ユーザー | 👑 testestest |
提出日時 | 2017-12-06 00:22:46 |
言語 | C (gcc 12.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 593 bytes |
コンパイル時間 | 473 ms |
コンパイル使用メモリ | 29,824 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-05-06 12:26:01 |
合計ジャッジ時間 | 3,317 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 0 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 3 ms
5,376 KB |
testcase_14 | RE | - |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | RE | - |
testcase_24 | RE | - |
testcase_25 | RE | - |
testcase_26 | RE | - |
testcase_27 | RE | - |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | num[10010]; | ^~~ main.c:2:1: warning: type defaults to 'int' in declaration of 'num' [-Wimplicit-int] main.c:3:1: warning: data definition has no type or storage class 3 | color[10010]; | ^~~~~ main.c:3:1: warning: type defaults to 'int' in declaration of 'color' [-Wimplicit-int] main.c:4:1: warning: data definition has no type or storage class 4 | r[10010],c[10010]; | ^ main.c:4:1: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:4:10: warning: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 4 | r[10010],c[10010]; | ^ main.c:5:1: warning: data definition has no type or storage class 5 | rcnt,ccnt; | ^~~~ main.c:5:1: warning: type defaults to 'int' in declaration of 'rcnt' [-Wimplicit-int] main.c:5:6: warning: type defaults to 'int' in declaration of 'ccnt' [-Wimplicit-int] 5 | rcnt,ccnt; | ^~~~ main.c:7:1: warning: data definition has no type or storage class 7 | n,k,q; | ^ main.c:7:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:7:3: warning: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 7 | n,k,q; | ^ main.c:7:5: warning: type defaults to 'int' in declaration of 'q' [-Wimplicit-int] 7 | n,k,q; | ^ main.c:8:1: warning: return type defaults to 'int' [-Wimplicit-int] 8 | main(){ | ^~~~ main.c: In function 'main': main.c:9:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 9 | scanf("%d%d%d\n",&n,&k,&q); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | char ch[10010]; main.c:9:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 9 | scanf("%d%d%d\n",&n,&k,&q); | ^~~~~ main.c:9:9: no
ソースコード
char ch[10010]; num[10010]; color[10010]; r[10010],c[10010]; rcnt,ccnt; long ans[10010]; n,k,q; main(){ scanf("%d%d%d\n",&n,&k,&q); for(int i=0;i<q;i++)scanf("%c%d%d\n",ch+i,num+i,color+i); while(q--){ // printf("%c%d%d\n",ch[q],num[q],color[q]); if(ch[q]=='C'){ if(!c[num[q]]++){ ans[color[q]]+=n-rcnt; ccnt++; } }else{ if(!r[num[q]]++){ ans[color[q]]+=n-ccnt; rcnt++; } } // for(int i=1;i<=k;i++)printf("%ld ",ans[i]);puts(""); } long temp=0; for(int i=1;i<=k;i++)temp+=ans[i]; ans[1]+=1LL*n*n-temp; for(int i=1;i<=k;i++)printf("%ld\n",ans[i]); }