Submission #14810864


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------


int D;
int C[26];
int S[400][26];
int T[400];
int day[26];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>D;
	FOR(i,26) cin>>C[i];
	FOR(i,D) {
		FOR(j,26) cin>>S[i][j];
	}
	
	int sum=0;
	FOR(i,D) {
		cin>>T[i];
		T[i]--;
		sum+=S[i][T[i]];
		day[T[i]]=i+1;
		FOR(j,26) sum-=C[j]*(i+1-day[j]);
		cout<<sum<<endl;
	}
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}

Submission Info

Submission Time
Task B - Scoring
User kmjp
Language C++ (GCC 9.2.1)
Score 1
Code Size 1045 Byte
Status AC
Exec Time 10 ms
Memory 3636 KB

Compile Error

./Main.cpp: In function ‘void solve()’:
./Main.cpp:23:10: warning: unused variable ‘k’ [-Wunused-variable]
   23 |  int i,j,k,l,r,x,y; string s;
      |          ^
./Main.cpp:23:12: warning: unused variable ‘l’ [-Wunused-variable]
   23 |  int i,j,k,l,r,x,y; string s;
      |            ^
./Main.cpp:23:14: warning: unused variable ‘r’ [-Wunused-variable]
   23 |  int i,j,k,l,r,x,y; string s;
      |              ^
./Main.cpp:23:16: warning: unused variable ‘x’ [-Wunused-variable]
   23 |  int i,j,k,l,r,x,y; string s;
      |                ^
./Main.cpp:23:18: warning: unused variable ‘y’ [-Wunused-variable]
   23 |  int i,j,k,l,r,x,y; string s;
      |                  ^
./Main.cpp: In function ‘int main(int, char**)’:
./Main.cpp:7:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    7 | #define FOR(x,to) for(x=0;x<(to);x++)
      |                            ^
./Main.cpp:46:38: note: in expansion of macro ‘FOR’
   46 |  FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
      |                                      ^~~

Judge Result

Set Name test_ALL
Score / Max Score 1 / 1
Status
AC × 5
Set Name Test Cases
test_ALL test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt
Case Name Status Exec Time Memory
test_00.txt AC 10 ms 3564 KB
test_01.txt AC 5 ms 3636 KB
test_02.txt AC 4 ms 3612 KB
test_03.txt AC 5 ms 3524 KB
test_04.txt AC 3 ms 3608 KB