結果
| 問題 |
No.504 ゲーム大会(ランキング)
|
| コンテスト | |
| ユーザー |
Imperi_Night
|
| 提出日時 | 2018-08-18 01:13:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 344 bytes |
| コンパイル時間 | 362 ms |
| コンパイル使用メモリ | 36,352 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-11 19:07:32 |
| 合計ジャッジ時間 | 1,766 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 3 WA * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d",&N);
| ~~~~~^~~~~~~~~
main.cpp:11:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | for(int i=0;i<N;i++)scanf("%d",&a[i]);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <vector>
using namespace std;
int main(){
int N;
scanf("%d",&N);
vector<int> a(N);
vector<int> rank(N);
for(int i=0;i<N;i++)scanf("%d",&a[i]);
rank[0]=1;
for(int i=1;i<N;i++){
if(a[i]>a[0])rank[i]=rank[i-1]+1;
}
for(int i=0;i<N;i++)printf("%d\n",rank[i]);
return 0;
}
Imperi_Night