# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1260432 | herominhsteve | Ljeto (COCI21_ljeto) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
#define el '\n'
#define FNAME "NAME"
#define allof(x) x.begin(),x.end()
#define allof1(x) x.begin()+1,x.end()
#define mset(x,n) memset(x,(n),sizeof(x))
using namespace std;
const long long MOD = (long long) 1e9+7;
template<class X,class Y> bool minimize(X &a,Y b){ if (a>b) {a=b; return true;} return false;}
template<class X,class Y> bool maximize(X &a,Y b){ if (a<b) {a=b; return true;} return false;}
void setup(){
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
if (fopen(FNAME".inp","r")){
freopen(FNAME".inp","r",stdin);
freopen(FNAME".out","w",stdout);
}
}
struct Spray{
int time;
int shot,hit;
int shotT,hitT;
Spray(int T=0,int S=0,int H=0){
time=T;
shot=S;
hit=H;
}
};
int n;
vector<Spray> a;
void init(){
cin>>n;
a.resize(n);
for (Spray &x:a) cin>>x.time>>x.shot>>x.hit;
}
void sol(){
int team1=0,team2=0;
for (int i=0;i<n;i++){
int &curteam = (a[i].shot <= 4 ? team1 : team2);
int curtime = a[i].time;
curteam+=100;
int j = i+1;
int cnt=0;
while (j<n and (a[j].time-curtime) <= 10 and a[j].shot==a[i].shot){
curteam += 150;
curtime = a[j].time;
j++;
}
i = j-1;
}
cout<<team1<<" "<<team2;
}
int main(){
setup();
init();
sol();
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |