cpp_lib

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub idat50me/cpp_lib

:heavy_check_mark: test/yuki_0117.cpp

Depends on

Code

// competitive-verifier: PROBLEM https://yukicoder.me/problems/no/117

#ifndef call_include
#define call_include
#include <bits/stdc++.h>
using namespace std;
#endif

#include "combinatorics/combinatorics.cpp"
#define MPRIME 1000000007LL

int main() {
	COMB comb(2100000, MPRIME);

	int T;
	cin >> T;
	for(int i = 0; i < T; i++) {
		int n = 0, r = 0, mode = -1;
		string S;
		cin >> S;
		bool fn = false;
		for(int j = 0; j < S.length(); j++) {
			char ch = S[j];
			switch(ch) {
				case 'C': mode = 0; break;
				case 'P': mode = 1; break;
				case 'H': mode = 2; break;
				case ',': fn = true; break;
				case '(':
				case ')': break;
				default:
					int d = (int)(ch - '0');
					if(fn) r = r * 10 + d;
					else
						n = n * 10 + d;
					break;
			}
		}
		switch(mode) {
			case 0: cout << comb.ncr(n, r) << endl; break;
			case 1: cout << comb.npr(n, r) << endl; break;
			case 2: cout << comb.nhr(n, r) << endl; break;
			default: return 0;
		}
	}
}
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj_resolve/resolver.py", line 181, in resolve
    bundled_code = language.bundle(path, basedir=basedir)
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 252, in bundle
    bundler.update(path)
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 422, in update
    raise BundleErrorAt(
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: test/yuki_0117.cpp: line 9: found codes out of include guard

Test cases

Env Name Status Elapsed Memory
g++ yuki.txt :heavy_check_mark: AC 173 ms 52 MB
clang++ yuki.txt :heavy_check_mark: AC 214 ms 52 MB
Back to top page