提交时间:2024-01-21 21:24:08
运行 ID: 121512
# include <bits/stdc++.h> using namespace std ; queue <int> ln ; int main ( ) { int sum = 0 ; for ( int i = 1 ; i <= 10 ; i ++ ) { while ( ! ln . empty ( ) ) { ln . pop ( ) ; } int cnt = 0 , cur = 0 ; for ( int j = 1 ; j <= 10 ; j ++ ) { int a ; cin >> a ; if ( a == 1 ) { cnt ++ ; } if ( cnt % 2 == 1 ) { cur = j + 1 ; } if ( cnt % 2 == 0 ) { sum += j - cur ; } ln . push ( a ) ; } } cout << sum << endl ; return 0 ; }