提出 #69836399
ソースコード 拡げる
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using db = double;
#define endl '\n'
#define MOD 998244353
LL qpow(LL x, LL power){
LL res = 1;
while(power){
if(power&1) res = res*x%MOD;
x=x*x%MOD;
power>>=1;
}
return res;
}
void solve()
{
vector<string> vs;
vs.emplace_back("Ocelot");
vs.emplace_back("Serval");
vs.emplace_back("Lynx");
string s1,s2;cin>>s1>>s2;
int id1,id2;
for(int i = 0;i<3;i++){
if(s1==vs[i]) id1 = i;
if(s2==vs[i]) id2 = i;
}
if(id1>=id2) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
int main()
{
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int T = 1;
//cin>>T;
while(T--)
solve();
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - OS Versions |
| ユーザ | Foolishfish |
| 言語 | C++ 20 (gcc 12.2) |
| 得点 | 100 |
| コード長 | 812 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3608 KiB |
コンパイルエラー
Main.cpp: In function ‘void solve()’:
Main.cpp:30:5: warning: ‘id2’ may be used uninitialized [-Wmaybe-uninitialized]
30 | if(id1>=id2) cout<<"Yes"<<endl;
| ^~
Main.cpp:25:13: note: ‘id2’ was declared here
25 | int id1,id2;
| ^~~
Main.cpp:30:5: warning: ‘id1’ may be used uninitialized [-Wmaybe-uninitialized]
30 | if(id1>=id2) cout<<"Yes"<<endl;
| ^~
Main.cpp:25:9: note: ‘id1’ was declared here
25 | int id1,id2;
| ^~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| sample_01.txt | AC | 1 ms | 3424 KiB |
| sample_02.txt | AC | 1 ms | 3396 KiB |
| sample_03.txt | AC | 1 ms | 3320 KiB |
| test_01.txt | AC | 1 ms | 3476 KiB |
| test_02.txt | AC | 1 ms | 3396 KiB |
| test_03.txt | AC | 1 ms | 3608 KiB |
| test_04.txt | AC | 1 ms | 3476 KiB |
| test_05.txt | AC | 1 ms | 3396 KiB |
| test_06.txt | AC | 1 ms | 3284 KiB |
| test_07.txt | AC | 1 ms | 3464 KiB |
| test_08.txt | AC | 1 ms | 3608 KiB |
| test_09.txt | AC | 1 ms | 3396 KiB |