Submission #18260585
Source Code Expand
using namespace std;
#include<iostream>
#include<vector>
#include<unordered_map>
#include<unordered_set>
#include<map>
#include<string>
#include<cctype>
#include <algorithm>
#include<cassert>
int main(void){
long long S,P;
cin >> S >> P;
long long ma = sqrt((double)P)+1;
for(int n=1;n<ma;++n){
if( P == n*(S-n) ){
cout << "Yes" << endl;
return 0;
}
}
cout <<"No" << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Sum and Product |
| User | destroist |
| Language | C++ (Clang 10.0.0) |
| Score | 300 |
| Code Size | 431 Byte |
| Status | AC |
| Exec Time | 6 ms |
| Memory | 3136 KiB |
Compile Error
./Main.cpp:1:17: warning: using directive refers to implicitly-defined namespace 'std'
using namespace std;
^
1 warning generated.
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| random_01.txt | AC | 6 ms | 3044 KiB |
| random_02.txt | AC | 2 ms | 3104 KiB |
| random_03.txt | AC | 2 ms | 3136 KiB |
| random_04.txt | AC | 2 ms | 2944 KiB |
| random_05.txt | AC | 2 ms | 3032 KiB |
| random_06.txt | AC | 2 ms | 3068 KiB |
| random_07.txt | AC | 3 ms | 3016 KiB |
| random_08.txt | AC | 2 ms | 3012 KiB |
| random_09.txt | AC | 5 ms | 3132 KiB |
| random_10.txt | AC | 2 ms | 3044 KiB |
| random_11.txt | AC | 2 ms | 2992 KiB |
| random_12.txt | AC | 2 ms | 3024 KiB |
| sample_01.txt | AC | 3 ms | 2980 KiB |
| sample_02.txt | AC | 2 ms | 3020 KiB |