답안 #1002662

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1002662 2024-06-19T17:43:10 Z Lobo MalnaRISC (COI21_malnarisc) C++17
0 / 100
1 ms 600 KB
#include<bits/stdc++.h>
using namespace std;
#define pb push_back

int main() {
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);

	int n; cin >> n;
	vector<string> lines;
	for(int i = 0; i < 7; i++) {
		lines.pb("");
		for(int x = 0; x < n; x++) {
			int y = (x^(1<<i));
			if(y > x) continue;
			lines.back() += ("CMPSWP R"+to_string(y+1)+" R"+to_string(x+1)+" ");
		}
		if(lines.back().size() == 0) lines.pop_back();
		else lines.back().pop_back();
	}

	vector<string> ans;
	for(int s = 0; s < lines.size(); s++) {
		for(int i = s-s; i < s-s+lines.size(); i++) {
			ans.pb(lines[i%(int) lines.size()]);
		}
	}

	cout << ans.size() << endl;
	for(auto x : ans) {
		cout << x << endl;
	}
}

Compilation message

malnarisc.cpp: In function 'int main()':
malnarisc.cpp:23:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |  for(int s = 0; s < lines.size(); s++) {
      |                 ~~^~~~~~~~~~~~~~
malnarisc.cpp:24:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   for(int i = s-s; i < s-s+lines.size(); i++) {
      |                    ~~^~~~~~~~~~~~~~~~~~
malnarisc.cpp:6:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  freopen("in.in","r",stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~
malnarisc.cpp:7:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  freopen("out.out","w",stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 600 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -