Submission #1090876

# Submission time Handle Problem Language Result Execution time Memory
1090876 2024-09-19T01:53:46 Z vjudge1 Automobil (COCI17_automobil) C++17
Compilation error
0 ms 0 KB
#include <iostream>

typedef long long ll;
const int LEN = 1'000'001;
const ll MOD = 1e9 + 7;
ll N, M, K;

ll R[LEN], C[LEN];
char c;

int main() {
	std::cin.tie(0)->sync_with_stdio(0);
	std::cin >> N >> M >> K;
	for (int i = 1; i <= N; ++i) R[i] = 1;
	for (int i = 1; i <= M; ++i) C[i] = 1;

	for (ll = 0, k, x, y; i < K; ++i) {
		std::cin >> c >> x >> y;
		if (c == 'R') R[x] = R[x] * y % MOD;
		else C[x] = C[x] * y % MOD;
	}

	// column process
	ll eff = 0;
	ll sum = 0;
	for (ll = 1; i <= M; ++i) {
		eff = (eff + C[i]) % MOD;
		sum = (sum + C[i] * i) % MOD;
	}

	// row proces
	ll ret = 0;
	for (ll i = 1; i <= N; ++i)
		ret = (ret + ((i - 1) * M % MOD * eff % MOD + sum) % MOD * R[i]) % MOD;
	std::cout << ret;
}

Compilation message

automobil.cpp: In function 'int main()':
automobil.cpp:17:10: error: expected unqualified-id before '=' token
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |          ^
automobil.cpp:17:9: error: expected ';' before '=' token
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |         ^~
      |         ;
automobil.cpp:17:10: error: expected primary-expression before '=' token
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |          ^
automobil.cpp:17:15: error: 'k' was not declared in this scope
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |               ^
automobil.cpp:17:18: error: 'x' was not declared in this scope
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |                  ^
automobil.cpp:17:21: error: 'y' was not declared in this scope
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |                     ^
automobil.cpp:17:24: error: 'i' was not declared in this scope
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |                        ^
automobil.cpp:17:29: error: expected ')' before ';' token
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |      ~                      ^
      |                             )
automobil.cpp:17:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |  ^~~
automobil.cpp:17:31: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |                               ^~
automobil.cpp:17:33: error: 'i' was not declared in this scope
   17 |  for (ll = 0, k, x, y; i < K; ++i) {
      |                                 ^
automobil.cpp:26:10: error: expected unqualified-id before '=' token
   26 |  for (ll = 1; i <= M; ++i) {
      |          ^
automobil.cpp:26:9: error: expected ';' before '=' token
   26 |  for (ll = 1; i <= M; ++i) {
      |         ^~
      |         ;
automobil.cpp:26:10: error: expected primary-expression before '=' token
   26 |  for (ll = 1; i <= M; ++i) {
      |          ^
automobil.cpp:26:21: error: expected ')' before ';' token
   26 |  for (ll = 1; i <= M; ++i) {
      |      ~              ^
      |                     )
automobil.cpp:26:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   26 |  for (ll = 1; i <= M; ++i) {
      |  ^~~
automobil.cpp:26:23: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   26 |  for (ll = 1; i <= M; ++i) {
      |                       ^~