Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
41765 | Hyma | 石头剪刀布 | C++ | Compile Error | 0 MS | 0 KB | 363 | 2024-02-23 10:54:12 |
#include<bits/stdc++.h> using namespace std; int main() { int n,k,r,s,t; char a[25]; string t; cin>>n>>k>>r>>s>>t; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ if(a[i]==a[i-k]){ continue; } else if(a[i]='r') sum+=c; else if(a[i]=='s') sum+=r; else if(a[i]=='c')sum+=s; } cout<<sum; return 0; }