# PRESENTING CODE
第三名:jellyfish (2AC) 1229 sec
第二名:ianwen (3AC) 2564 sec
第一名:keaucucal (3AC) 1063 sec
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"Hello 電神!\n";
}
# PRESENTING CODE
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
string people;
int p;
cin>>people>>p;
if(p>n+10){
cout<<people<<"太低lalalalalalala !\n";
}else if(p<n-10){
cout<<people<<"太高lalalalala !\n";
}else{
cout<<people<<"太強lalalala !\n";
}
cin>>people>>p;
if(p>n+10){
cout<<people<<"太低lalalalalalala !\n";
}else if(p<n-10){
cout<<people<<"太高lalalalala !\n";
}else{
cout<<people<<"太強lalalala !\n";
}
cin>>people>>p;
if(p>n+10){
cout<<people<<"太低lalalalalalala !\n";
}else if(p<n-10){
cout<<people<<"太高lalalalala !\n";
}else{
cout<<people<<"太強lalalala !\n";
}
cin>>people>>p;
if(p>n+10){
cout<<people<<"太低lalalalalalala !\n";
}else if(p<n-10){
cout<<people<<"太高lalalalala !\n";
}else{
cout<<people<<"太強lalalala !\n";
}
}
# PRESENTING CODE
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
string people;
int p;
for(int i=0;i<4;i++){
cin>>people>>p;
if(p>n+10){
cout<<people<<"太低lalalalalalala !\n";
}else if(p<n-10){
cout<<people<<"太高lalalalala !\n";
}else{
cout<<people<<"太強lalalala !\n";
}
}
}
# PRESENTING CODE
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
string w[n];
long long a[n],s=0;
for(int i=0;i<n;i++){
cin>>w[i]>>a[i];
s+=a[i];
}
cout<<w[s%n]<<"太電了OrzOrz\n";
}
# PRESENTING CODE
#include <bits/stdc++.h>
using namespace std;
int people;
char arr[14]={'A', '1', '2', '3', '4', '5', '6', '7', '8', '9', 't', 'j', 'q', 'k'};
signed main(){
int turns;cin>>people>>turns;
int died[(int)1e6]={0}; //儲存每個人是否已經死亡
int pile=0, next_person=0, direction=1;
/*
pile: 目前牌海數值
next_person: 下一個出牌者
direction: 目前進行方向(可能被使用4迴轉而轉向號碼小者)
*/
while(turns--){
char poker;cin>>poker; //現在被出出來的那張牌
if(poker=='4'){
direction*=-1; //轉向 1變-1 -1變1
}else if(poker=='5'){
int next;
cin>>next; //輸入下一個人
next_person=next; //把下一個人設定成剛輸入的值
continue;
}else if(poker=='j'){
int orz807; //其實只是跳過 避免進入else 一個分號就夠了 但807 so dian
}else if(poker=='t'){
pile-=10; //牌堆減十
}else if(poker=='q'){
pile-=20; //牌堆減二十
}else if(poker=='k'){
pile=99; //牌堆直接變成99
}else if(poker=='A'){
pile=0; //牌堆歸零
}else{
pile+=poker-'0';
/*
其他情況下 便將牌海加上該數字
但這邊存的poker變數為字元
因此需將字元轉換成數字
方式則為 char-'0'
詳情請見ascii table
*/
}
if(pile>99){
died[next_person]=true;
pile-=(poker-'0');
cout<<next_person<<"\n";
/*
如果他出完牌後牌堆爆了
就把他設定成死了
*/
}
while(true){
next_person+=direction;
next_person=(next_person+people)%people;
if(!died[next_person]) break;
/*
往下一個人邁進
如果死了 就繼續走
*/
}
}
for(int i=0; i<people; i++) if(!died[i]) cout<<i<<' ';
}
# PRESENTING CODE