結果

問題 No.2091 Shio Ramen (Easy)
ユーザー 👑 CleyL
提出日時 2022-10-06 22:44:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 807 ms
コンパイル使用メモリ 67,168 KB
最終ジャッジ日時 2025-02-07 22:22:28
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    int n,m,k;cin>>n>>m>>k;
    int dist = k+1;
    int ans = -1;
    for(int i = 0; n > i; i++){
        int x;cin>>x;
        if(m-k <= x && x <= m+k){
            if(dist > abs(x-n)){
                dist = abs(x-n);
                ans = i+1;
            }
        }
    }
    if(ans == -1){
        cout << "Unlucky!" << endl;
    }else{
        cout << ans << endl;
    }
}
0