結果
| 問題 |
No.504 ゲーム大会(ランキング)
|
| コンテスト | |
| ユーザー |
Haijinn
|
| 提出日時 | 2017-04-23 17:28:17 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 301 bytes |
| コンパイル時間 | 664 ms |
| コンパイル使用メモリ | 21,120 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-22 07:49:49 |
| 合計ジャッジ時間 | 2,283 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 8 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:12:9: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=]
12 | scanf("%d",&p[0]);
| ~^ ~~~~~
| | |
| | long int *
| int *
| %ld
main.c:14:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=]
14 | scanf("%d",&p[i]);
| ~^ ~~~~~
| | |
| | long int *
| int *
| %ld
main.c:21:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
21 | printf("%d\n",x);
| ~^ ~
| | |
| int long int
| %ld
main.c:28:10: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
28 | printf("%d\n",x);
| ~^ ~
| | |
| int long int
| %ld
main.c:11:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:12:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d",&p[0]);
| ^~~~~~~~~~~~~~~~~
main.c:14:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%d",&p[i]);
| ^~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int main(){
int i;
int z=0;
int n;
long p[100000];
long x=1;
int temp;
scanf("%d",&n);
scanf("%d",&p[0]);
for(i=1;i<n;i++){
scanf("%d",&p[i]);
}
for(i=1;i<n;i++){
printf("%d\n",x);
if(p[0]<p[i]){
x++;
}
}
printf("%d\n",x);
return 0;
}
Haijinn