제출 #1342182

#제출 시각아이디문제언어결과실행 시간메모리
1342182top1svtinJJOOII 2 (JOI20_ho_t2)C++17
0 / 100
1 ms344 KiB
#include<bits/stdc++.h>

using namespace std ;

#define ll long long
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
#define task "kien"

const int NUMTEST = 1000;

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll l, ll r) { assert(l <= r); return uniform_int_distribution<ll>(l, r)(rd); }

main() {
    for (int itest = 1; itest <= NUMTEST; itest++) {
        ofstream fout("kien.inp");

        int n = 10;
        int k = rand(1, 3);

        fout << n << ' ' << k << "\n";

        for (int i = 1; i <= n; i++) {
            int kk = rand(1, 3);
            if (kk == 1) fout << 'J';
            else if (kk == 2) fout  << 'O';
            else fout << 'I';
        }

        fout.close();

        system("sol.exe");
        system("good.exe");
        if (system("fc kien.out kien.ans") == 0) cout << "correct!\n";
        else {
            cout << "wrong!\n";
            return 0;
        }
    }
}

컴파일 시 표준 에러 (stderr) 메시지

ho_t2.cpp:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   15 | main() {
      | ^~~~
ho_t2.cpp: In function 'int main()':
ho_t2.cpp:33:15: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |         system("sol.exe");
      |         ~~~~~~^~~~~~~~~~~
ho_t2.cpp:34:15: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   34 |         system("good.exe");
      |         ~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...