Submission #15423

#TimeUsernameProblemLanguageResultExecution timeMemory
15423kesakiyo6님 무기가 좀 나쁘시네여 (kriii3_S)C++98
0 / 29
0 ms1084 KiB
#include <stdio.h> #include <algorithm> using namespace std; typedef long long ll; struct DATA { ll val[5]; DATA() {} DATA(ll a, ll b, ll c, ll d, ll e) { val[0]=a; val[1]=b; val[2]=c; val[3]=d; val[4]=e; } ll getCost() { return val[0]*(100LL+val[1])*((100LL-min(val[2], 100LL))+min(val[2], 100LL)*val[3])*(100+val[4]); } DATA operator - (const DATA& r) { return DATA(val[0]-r.val[0], val[1]-r.val[1], val[2]-r.val[2], val[3]-r.val[3], val[4]-r.val[4]); } DATA operator + (const DATA& r) { return DATA(val[0]+r.val[0], val[1]+r.val[1], val[2]+r.val[2], val[3]+r.val[3], val[4]+r.val[4]); } char inputData() { char ch; for(int i=0 ; i<5 ; i++) ch=scanf("%lld", &val[i]); return ch; } void test() { for(int i=0 ; i<5 ; i++) printf("%lld ", val[i]); puts(""); } }; char comp(DATA prev, DATA cur) { ll prevCost=prev.getCost(); ll curCost=cur.getCost(); if(prevCost==curCost) return '0'; else if(prevCost<curCost) return '+'; else return '-'; } DATA ca, cb, w1, w2, pa, pb; int main() { while(1) { ca.inputData(); cb.inputData(); w1.inputData(); if(w2.inputData()==EOF) break; pa=ca-w1; pb=cb-w2; printf("%c\n", comp(ca, pa+w2)); printf("%c\n", comp(cb, pb+w1)); } }
#Verdict Execution timeMemoryGrader output
Fetching results...