# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
467629 | 2021-08-23T22:11:57 Z | urosk | Game (eJOI20_game) | C++14 | 1 ms | 204 KB |
// __builtin_popcount(x) broj bitova // __builtin_popcountll(x) long long #define here cerr<<"---------------------------\n" #include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> #define ld double #define ll long long #define ull unsigned long long #define llinf 100000000000000000LL // 10^17 #define iinf 2000000000 // 2*10^9 #define pb push_back #define popb pop_back #define fi first #define sc second #define endl '\n' #define pii pair<int,int> #define pll pair<ll,ll> #define pld pair<ld,ld> #define sz(a) int(a.size()) #define all(a) a.begin(),a.end() #define rall(a) a.begin(),a.end(),greater<int>() #define getunique(v) {sort(all(v)); v.erase(unique(all(v)), v.end());} using namespace std; using namespace __gnu_pbds; typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; void setIO(string inoutname) { freopen((inoutname+".in").c_str(),"r",stdin); freopen((inoutname+".out").c_str(),"w",stdout); } ll gcd(ll a, ll b) { if(b==0) return a; if(a==0) return b; if(a>=b) return gcd(a%b,b); return gcd(a,b%a); } #define maxn 25 ll n,m; bool a[maxn][maxn]; bool b[maxn][maxn]; void tc(){ ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0); cin >> n >> m; for(ll i = 1;i<=n+1;i++){ string s; cin >> s; for(ll j = 1;j<=m;j++) a[i][j] = s[j-1]-'0'; } here; for(ll i = 1;i<=m;i++){ string s; cin >> s; for(ll j = 1;j<=n+1;j++) b[i][j] = s[j-1]-'0'; } ll ans = 0; for(ll x = 1;x<=n;x++){ for(ll y = 1;y<=m;y++){ if(a[x][y]==0||a[x+1][y]==0||b[x][y]==0||b[x][y+1]==0){ //cerr<<x<< " "<<y<<endl; ans++; } } } cout<<-ans<<endl; } int main(){ ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0); //setIO("lol"); int t; t = 1; while(t--){ tc(); } return 0; } /* 3 3 110 110 110 110 1111 1111 0000 */
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 1 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |