Submission #3435185
Source Code Expand
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <utility> #include <cstring> #include <cmath> #include <queue> #include <stack> #include <map> #define INF (long)1e9 const int MOD = 1e9 + 7; const int dx[] = {1, -1, 0, 0}; const int dy[] = {0, 0, 1, -1}; using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int a, b, c; cin >> a >> b >> c; int cnt = 0; int tmp = a; while(1) { if(a % b == c) { cout << "Yes" << endl; return 0; } a += tmp; if(cnt >= 1000000) break; cnt++; } cout << "No" << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Choose Integers |
User | Shimejime |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 663 Byte |
Status | WA |
Exec Time | 4 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0, example1, example2, example3, example4 |
All | ansno0, ansno1, ansno2, ansno3, ansno4, ansyes0, ansyes1, ansyes2, ansyes3, ansyes4, example0, example1, example2, example3, example4 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
ansno0 | WA | 4 ms | 256 KB |
ansno1 | WA | 4 ms | 256 KB |
ansno2 | WA | 4 ms | 256 KB |
ansno3 | WA | 4 ms | 256 KB |
ansno4 | WA | 4 ms | 256 KB |
ansyes0 | WA | 1 ms | 256 KB |
ansyes1 | WA | 1 ms | 256 KB |
ansyes2 | WA | 1 ms | 256 KB |
ansyes3 | WA | 1 ms | 256 KB |
ansyes4 | WA | 1 ms | 256 KB |
example0 | WA | 1 ms | 256 KB |
example1 | WA | 4 ms | 256 KB |
example2 | WA | 1 ms | 256 KB |
example3 | WA | 1 ms | 256 KB |
example4 | WA | 4 ms | 256 KB |