Submission #420978

# Submission time Handle Problem Language Result Execution time Memory
420978 2021-06-08T15:47:41 Z Nicholas_Patrick MalnaRISC (COI21_malnarisc) C++17
0 / 100
1 ms 332 KB
#include <cstdio>
#include <queue>
using namespace std;

int main(){
	int n;
	scanf("%d", &n);
	for(int i=n; i--;){
		vector<pair<int, int>> a;
		for(int j=i&1; j+1<n; j+=2)
			a.emplace_back(j+1, j+2);
		for(int j=0; j<a.size(); j++)
			printf("CMPSWP R%d R%d%c", a[j].first, a[j].second, " \n"[j==a.size()-1]);
	}
}

Compilation message

malnarisc.cpp: In function 'int main()':
malnarisc.cpp:12:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   for(int j=0; j<a.size(); j++)
      |                ~^~~~~~~~~
malnarisc.cpp:13:63: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |    printf("CMPSWP R%d R%d%c", a[j].first, a[j].second, " \n"[j==a.size()-1]);
      |                                                              ~^~~~~~~~~~~~
malnarisc.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Expected integer, but "CMPSWP" found
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Expected integer, but "CMPSWP" found