Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
2112 A班-岑思熠 胜负对决 C++ 通过 100 0 MS 256 KB 453 2024-12-14 11:15:43

Tests(3/3):


#include<bits/stdc++.h> using namespace std; int main() { int n,sum=0,temp=0; cin>>n; int a[n+1]; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(i%2!=0) { sum+=a[i]; } else { temp+=a[i]; } } cout<<"KING"<<" "<<sum<<endl; cout<<"WIN"<<" "<<temp<<endl; if(sum>temp) { cout<<"KING"; } else if(temp>sum) { cout<<"WIN"; } else { cout<<"KING"; } return 0; }


测评信息: