Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
87379 sh25_wanghy 灯的排列问题 C++ Accepted 0 MS 196 KB 369 2026-04-17 14:42:55

Tests(3/3):


#include <cstdio> int N; int M; char p; int n; int s = 0; int main() { scanf("%d", &N); s = N; while(scanf(" %c", &p) != EOF) { if(p == 'Q') break; scanf("%d", &n); s -= n; M++; } s += 2; int mul = 1; for(int i = 1; i <= M; i++) mul *= (s - i); printf("%d", mul); return 0; }


Judgement Protocol: