Submission #207834

#TimeUsernameProblemLanguageResultExecution timeMemory
207834BlerarghBitaro the Brave (JOI19_ho_t1)C++17
0 / 100
5 ms504 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> ii; typedef pair<ld,ld> id; #define FOR(i, a, b) for(int i=(a); i<=(b); i++) #define ROF(i, a, b) for(int i=(a); i>=(b); i--) #define MEM(x, v) memset(x, v, sizeof(x)) #define SORT(x) sort((x).begin(), (x).end()) #define CMPSORT(x, cp) sort((x).begin(), (x).end(), cp) #define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define f first #define s second #define e emplace #define eb emplace_back #define ef emplace_front #define ins insert #define p push #define pf push_front #define pb push_back #define mp make_pair #define getchar_unlocked _getchar_nolock #define INF ((long long)1e18) #define MOD 1000000007 #define db cout<<"YEET\n"; #define ct(x) cout<<x<<'\n'; int main(){ FAST ll h, w; char grid[100][100]; cin >> h >> w; FOR(i, 1, h){ FOR(j, 1, w){ char c; cin >> grid[i][j]; } } ll power[100], total=0; MEM(power, 0); FOR(i, 1, h){ FOR(j, 1, w){ if (grid[i][j]=='I') total+=power[j]; } ll ocnt=0; ROF(j, w, 1){ if (grid[i][j]=='O') ocnt++; if (grid[i][j]=='J') power[j]+=ocnt; } } cout << total; }

Compilation message (stderr)

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:39:18: warning: unused variable 'c' [-Wunused-variable]
             char c;
                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...