結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
gotutiyan
|
| 提出日時 | 2017-11-16 00:18:45 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 782 bytes |
| コンパイル時間 | 620 ms |
| コンパイル使用メモリ | 84,868 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-25 04:09:55 |
| 合計ジャッジ時間 | 1,433 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:44:9: warning: 'maxnum' may be used uninitialized [-Wmaybe-uninitialized]
44 | if (maxnum == 0) cout << "YES" << endl;
| ^~
main.cpp:37:23: note: 'maxnum' was declared here
37 | int maxx = 0, maxnum;
| ^~~~~~
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <cmath>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define repp(i,j,k) for(int i=j;i>=k;i--)
#define Sort(x) sort(x.begin(),x.end());
#define ll long long
int mod=1e9+7;
const int INF = 1e9;
using namespace std;
int main(void) {
int n;
cin >> n;
vector<int> vv(n),v(102,0);
rep(i, 0, n) {
cin >> vv[i];
}
rep(i, 0, n) {
int x;
cin >> x;
v[x] += vv[i];
}
int maxx = 0, maxnum;
rep(i, 0, 102) {
if (maxx <v[i]) {
maxx = v[i];
maxnum = i;
}
}
if (maxnum == 0) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}
gotutiyan