結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー | Yamyuki |
提出日時 | 2016-11-20 11:07:43 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,172 bytes |
コンパイル時間 | 266 ms |
コンパイル使用メモリ | 24,004 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-05-05 10:39:20 |
合計ジャッジ時間 | 1,484 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
コンパイルメッセージ
main.c: In function ‘main’: main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d",&n); | ^~~~~~~~~~~~~~ main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d",&l[i]); | ^~~~~~~~~~~~~~~~~ main.c:14:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%d",&t); | ^~~~~~~~~~~~~~ main.c:21:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | scanf("%c",&name[0][j]); | ^~~~~~~~~~~~~~~~~~~~~~~ main.c:27:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 27 | scanf("%c",&p); | ^~~~~~~~~~~~~~ main.c:53:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 53 | scanf("%c",&p); | ^~~~~~~~~~~~~~ main.c:80:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 80 | scanf("%c",&p); | ^~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<string.h> int main(){ int n,l[26],t,i,j,player,id,ac[26],score[4000][27],sort[4000],pp,h; char name[4001][17],p; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&l[i]); ac[i]=0; } scanf("%d",&t); player=0; for(i=0;i<t;i++){ j=-1; getchar(); do{ j++; scanf("%c",&name[0][j]); }while(name[0][j]!=' '); name[0][j]='\0'; if(player==0){ strcpy(name[1],name[0]); player++; scanf("%c",&p); for(pp=0;pp<n+1;pp++){ score[0][pp]=0; } pp=0; while(pp<25){ if(p=='A'+('B'-'A')*pp){ break; } pp++; } ac[pp]++; score[0][pp]=50*l[pp]+(int)(50*l[pp]/(0.8+0.2*ac[pp])); score[0][n]=score[0][pp]; sort[0]=0; }else{ id=0; for(j=1;j<=player;j++){ if(strcmp(name[0],name[j])==0){ id=j; j=player; } } if(id==0){ player++; strcpy(name[player],name[0]); scanf("%c",&p); for(pp=0;pp<n+1;pp++){ score[player-1][pp]=0; } pp=0; while(pp<25){ if(p=='A'+('B'-'A')*pp){ break; } pp++; } ac[pp]++; score[player-1][pp]=50*l[pp]+(int)(50*l[pp]/(0.8+0.2*ac[pp])); score[player-1][n]=score[player-1][pp]; sort[player-1]=player-1; pp=player-1; while(pp>1){ if(score[sort[pp-1]][n]<score[sort[pp]][n]){ h=sort[pp]; sort[pp]=sort[pp-1]; sort[pp-1]=h; }else{ pp=1; } pp--; } }else{ scanf("%c",&p); pp=0; while(pp<25){ if(p=='A'+('B'-'A')*pp){ break; } pp++; } ac[pp]++; score[id-1][pp]=50*l[pp]+(int)(50*l[pp]/(0.8+0.2*ac[pp])); score[id-1][n]+=score[id-1][pp]; pp=0; while(sort[pp]!=id-1){ pp++; } while(pp>0){ if(score[sort[pp-1]][n]<score[sort[pp]][n]){ h=sort[pp]; sort[pp]=sort[pp-1]; sort[pp-1]=h; }else{ pp=1; } pp--; } } } } for(i=0;i<player;i++){ printf("%d %s",i+1,name[sort[i]+1]); for(j=0;j<=n;j++){ printf(" %d",score[sort[i]][j]); } printf("\n"); } return 0; }