Submission #51177799
Source Code Expand
// LUOGU_RID: 150538652
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll MOD=998244353;
// head
signed main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
int v,a,b,c;cin>>v>>a>>b>>c;
int k=0;
while(v>=0)
{
if(!k) {
if(v>=a) v-=a;
else {cout<<"F"<<endl;return 0;}
}
else if(k==1) {
if(v>=b) v-=b;
else {cout<<"M"<<endl;return 0;}
}
else {
if(v>=c) v-=c;
else {cout<<"T"<<endl;return 0;}
}
k=(k+1)%3;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Shampoo |
| User | gangbengr |
| Language | C++ 17 (gcc 12.2) |
| Score | 100 |
| Code Size | 750 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3652 KiB |
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, sample_03.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, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| random_01.txt | AC | 1 ms | 3604 KiB |
| random_02.txt | AC | 1 ms | 3420 KiB |
| random_03.txt | AC | 1 ms | 3580 KiB |
| random_04.txt | AC | 1 ms | 3528 KiB |
| random_05.txt | AC | 1 ms | 3528 KiB |
| random_06.txt | AC | 1 ms | 3448 KiB |
| random_07.txt | AC | 1 ms | 3524 KiB |
| random_08.txt | AC | 1 ms | 3576 KiB |
| sample_01.txt | AC | 1 ms | 3396 KiB |
| sample_02.txt | AC | 1 ms | 3432 KiB |
| sample_03.txt | AC | 1 ms | 3652 KiB |