Submission #1519493
Source Code Expand
#include <map> #include <set> #include <list> #include <cmath> #include <deque> #include <queue> #include <stack> #include <cstdio> #include <string> #include <vector> #include <complex> #include <cstdlib> #include <cstring> #include <numeric> #include <utility> #include <iostream> #include <algorithm> #include <functional> #include <unordered_map> #include <unordered_set> using namespace std; #define ll long long #define ull unsigned long long #define INF (1 << 29) #define LLINF (1LL << 61) #define MOD7 1000000007 #define MOD9 1000000009 #define eps 1e-9 #define P pair<int, int> #define pii pair<int, int> #define pll pair<ll, ll> #define pul pair<ull, ull> #define all(a) (a).begin(), (a).end() #define FOR(i,a,b) for (int i=(a);i<(b);++i) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i) #define REP(i,n) for (int i=0;i<(n);++i) #define RREP(i,n) for (int i=(n)-1;i>=0;--i) void YES() { cout << "YES" << endl; } void NO() { cout << "NO" << endl; } void Yes() { cout << "Yes" << endl; } void No() { cout << "No" << endl; } void yes() { cout << "yes" << endl; } void no() { cout << "no" << endl; } int main() { int n, a, b; string s[] = { "Bug", "Ant" }; cin >> n >> a >> b; for (int i = 0; ; ++i) { if (n <= 0) { cout << s[i % 2] << endl; break; } if (i % 2) n -= b; else n -= a; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 小石を取るゲーム |
User | temple |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 1400 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | sample_01.txt, sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
subtask1_01.txt | AC | 1 ms | 256 KB |
subtask1_02.txt | AC | 1 ms | 256 KB |
subtask1_03.txt | AC | 1 ms | 256 KB |
subtask1_04.txt | AC | 1 ms | 256 KB |
subtask1_05.txt | AC | 1 ms | 256 KB |
subtask1_06.txt | AC | 1 ms | 256 KB |
subtask1_07.txt | AC | 1 ms | 256 KB |
subtask1_08.txt | AC | 1 ms | 256 KB |
subtask1_09.txt | AC | 1 ms | 256 KB |
subtask1_10.txt | AC | 1 ms | 256 KB |
subtask1_11.txt | AC | 1 ms | 256 KB |
subtask1_12.txt | AC | 1 ms | 256 KB |
subtask1_13.txt | AC | 1 ms | 256 KB |