結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-10-02 01:02:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 298 bytes |
| コンパイル時間 | 1,203 ms |
| コンパイル使用メモリ | 51,712 KB |
| 最終ジャッジ日時 | 2024-11-14 19:17:37 |
| 合計ジャッジ時間 | 1,589 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:5: error: ‘vector’ was not declared in this scope
7 | vector<int> a(n), b(n), c(101);
| ^~~~~~
main.cpp:3:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
2 | #include <algorithm>
+++ |+#include <vector>
3 | using namespace std;
main.cpp:7:12: error: expected primary-expression before ‘int’
7 | vector<int> a(n), b(n), c(101);
| ^~~
main.cpp:8:17: error: ‘a’ was not declared in this scope
8 | for(int& v: a) cin>>v;
| ^
main.cpp:9:17: error: ‘b’ was not declared in this scope
9 | for(int& v: b) cin>>v;
| ^
main.cpp:11:26: error: ‘c’ was not declared in this scope
11 | for(int i=0;i<n;++i) c[b[i]]+=a[i];
| ^
main.cpp:11:28: error: ‘b’ was not declared in this scope
11 | for(int i=0;i<n;++i) c[b[i]]+=a[i];
| ^
main.cpp:11:35: error: ‘a’ was not declared in this scope
11 | for(int i=0;i<n;++i) c[b[i]]+=a[i];
| ^
main.cpp:12:31: error: ‘c’ was not declared in this scope
12 | cout<<(*max_element(begin(c), end(c))==c[0] ? "YES" : "NO")<<endl;
| ^
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n; cin>>n;
vector<int> a(n), b(n), c(101);
for(int& v: a) cin>>v;
for(int& v: b) cin>>v;
for(int i=0;i<n;++i) c[b[i]]+=a[i];
cout<<(*max_element(begin(c), end(c))==c[0] ? "YES" : "NO")<<endl;
}
hogeover30