結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー | Yamyuki |
提出日時 | 2016-11-20 13:43:28 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 2,139 bytes |
コンパイル時間 | 237 ms |
コンパイル使用メモリ | 23,296 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 06:54:07 |
合計ジャッジ時間 | 1,612 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 4 ms
5,248 KB |
testcase_04 | AC | 5 ms
5,248 KB |
testcase_05 | AC | 24 ms
5,248 KB |
testcase_06 | AC | 27 ms
5,248 KB |
testcase_07 | AC | 12 ms
5,248 KB |
testcase_08 | AC | 13 ms
5,248 KB |
testcase_09 | AC | 32 ms
5,248 KB |
testcase_10 | AC | 3 ms
5,248 KB |
testcase_11 | AC | 6 ms
5,248 KB |
testcase_12 | AC | 7 ms
5,248 KB |
testcase_13 | AC | 26 ms
5,248 KB |
testcase_14 | AC | 38 ms
5,248 KB |
testcase_15 | AC | 6 ms
5,248 KB |
testcase_16 | AC | 3 ms
5,248 KB |
testcase_17 | AC | 5 ms
5,248 KB |
testcase_18 | AC | 2 ms
5,248 KB |
testcase_19 | AC | 33 ms
5,248 KB |
testcase_20 | AC | 36 ms
5,248 KB |
testcase_21 | AC | 6 ms
5,248 KB |
testcase_22 | AC | 6 ms
5,248 KB |
testcase_23 | AC | 8 ms
5,248 KB |
testcase_24 | AC | 21 ms
5,248 KB |
testcase_25 | AC | 29 ms
5,248 KB |
testcase_26 | AC | 12 ms
5,248 KB |
testcase_27 | AC | 10 ms
5,248 KB |
コンパイルメッセージ
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]+(250*l[pp]/(4+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]+(250*l[pp]/(4+ac[pp])); score[player-1][n]=score[player-1][pp]; sort[player-1]=player-1; pp=player-1; 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--; } }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]+(250*l[pp]/(4+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; }