Submission #97786

# Submission time Handle Problem Language Result Execution time Memory
97786 2019-02-18T13:22:23 Z AKaan37 Bitaro the Brave (JOI19_ho_t1) C++14
20 / 100
34 ms 7800 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long int lo;
typedef pair< int,int > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)

const int inf = 1000000000;
const int mod = 1000000007;
const int KOK = 100000;
const int li = 100005;
const int LOG = 20;

int n,m,cev,x,k,O[3005][3005],I[3005][3005];
vector<int> v;
char c[3005][3005];
string s;

int main(){
	scanf("%d %d",&n,&m);
	FOR{
		for(int j=1;j<=m;j++){
			scanf(" %c",&c[i][j]);
			if(c[i][j]=='O') O[i][j]=O[i][j-1]+1;
			if(c[i][j]!='O') O[i][j]=O[i][j-1];
			if(c[i][j]=='I') I[i][j]=I[i-1][j]+1;
			if(c[i][j]!='I') I[i][j]=I[i-1][j];
		}
	}
	FOR{
		for(int j=1;j<=m;j++){
			//~ cout<<O[i][m]-O[i][j]<<" ";
			if(c[i][j]=='J') cev+=(O[i][m]-O[i][j])*(I[n][j]-I[i][j]);
			//~ if(c[i][j]=='J') cev+=I[j];
		}
		//~ cout<<endl;
	}
	printf("%d\n",cev);
	return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:27:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:30:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf(" %c",&c[i][j]);
    ~~~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 4 ms 1536 KB Output is correct
7 Correct 4 ms 1408 KB Output is correct
8 Correct 5 ms 1536 KB Output is correct
9 Correct 4 ms 1536 KB Output is correct
10 Correct 5 ms 1408 KB Output is correct
11 Correct 1 ms 1536 KB Output is correct
12 Correct 4 ms 1536 KB Output is correct
13 Correct 4 ms 1408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 4 ms 1536 KB Output is correct
7 Correct 4 ms 1408 KB Output is correct
8 Correct 5 ms 1536 KB Output is correct
9 Correct 4 ms 1536 KB Output is correct
10 Correct 5 ms 1408 KB Output is correct
11 Correct 1 ms 1536 KB Output is correct
12 Correct 4 ms 1536 KB Output is correct
13 Correct 4 ms 1408 KB Output is correct
14 Correct 26 ms 7296 KB Output is correct
15 Correct 7 ms 4992 KB Output is correct
16 Correct 19 ms 4224 KB Output is correct
17 Correct 3 ms 512 KB Output is correct
18 Correct 30 ms 7800 KB Output is correct
19 Correct 34 ms 7672 KB Output is correct
20 Incorrect 33 ms 7672 KB Output isn't correct
21 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 4 ms 1536 KB Output is correct
7 Correct 4 ms 1408 KB Output is correct
8 Correct 5 ms 1536 KB Output is correct
9 Correct 4 ms 1536 KB Output is correct
10 Correct 5 ms 1408 KB Output is correct
11 Correct 1 ms 1536 KB Output is correct
12 Correct 4 ms 1536 KB Output is correct
13 Correct 4 ms 1408 KB Output is correct
14 Correct 26 ms 7296 KB Output is correct
15 Correct 7 ms 4992 KB Output is correct
16 Correct 19 ms 4224 KB Output is correct
17 Correct 3 ms 512 KB Output is correct
18 Correct 30 ms 7800 KB Output is correct
19 Correct 34 ms 7672 KB Output is correct
20 Incorrect 33 ms 7672 KB Output isn't correct
21 Halted 0 ms 0 KB -