Quellcode durchsuchen

周赛三第一题题解

liuhuan vor 5 Jahren
Ursprung
Commit
f634837070
3 geänderte Dateien mit 29 neuen und 0 gelöschten Zeilen
  1. 4 0
      .idea/misc.xml
  2. 6 0
      .idea/vcs.xml
  3. 19 0
      A.cpp.cpp

+ 4 - 0
.idea/misc.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 19 - 0
A.cpp.cpp

@@ -0,0 +1,19 @@
+//
+// Created by liuhuan on 18-10-29.
+//
+#include <bits/stdc++.h>
+
+using namespace std;
+
+int main() {
+    int n;
+    while(cin>>n){
+        long long s=1;
+        while(n>1){
+            s=(s+1)*2;
+            n--;
+        }
+        cout<<s<<endl;
+    }
+    return 0;
+}