提交时间:2024-01-21 15:15:26
运行 ID: 121095
# 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 cur = 0 ; for ( int j = 1 ; j <= 10 ; j ++ ) { int a ; cin >> a ; if ( cur == 0 && a == 1 ) { cur = j ; } else if ( a == 1 && queue . back ( ) != 1 ) { sum += ( j - cur - 2 ) ; } ln . push ( a ) ; } } cout << sum << endl ; return 0 ; }