結果

問題 No.8090 Knapsack Function
ユーザー SSRS
提出日時 2022-03-22 06:43:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 1,783 ms
コンパイル使用メモリ 194,488 KB
最終ジャッジ日時 2025-01-28 10:58:26
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> v(N), w(N);
  for (int i = 0; i < N; i++){
    cin >> v[i] >> w[i];
  }
  bool ok = false;
  for (int i = 0; i < N; i++){
    if (w[i] == 1){
      ok = true;
    }
  }
  if (ok){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
0